Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How create package in Laravel 5?

php artisan workbench vendor/package --resources 

command is not available in laravel 5, but how now create package in laravel 5 ?

like image 711
Marty Aghajanyan Avatar asked Dec 26 '14 19:12

Marty Aghajanyan


People also ask

What is package in Laravel?

Packages are the primary way of adding functionality to Laravel. Packages might be anything from a great way to work with dates like Carbon or a package that allows you to associate files with Eloquent models like Spatie's Laravel Media Library. There are different types of packages.

How many packages are in Laravel?

As of now, there are over 500 Laravel packages on. They offer all sorts of functionality from booking and travel to eCommerce and instruction.


2 Answers

Shameless self-promotion, but I've written a post about this called "Creating Laravel 5 packages for dummies" that explains how to create the package, how to put it on GitHub & Packagist and how to push changes/new versions afterwards.

If you're already familiar with creating packages in Laravel 4, the fastest solution I've found was to use this CLI tool.

like image 173
tabacitu Avatar answered Sep 24 '22 13:09

tabacitu


The laravel workbench has been renamed in laravel 5 to "Package Development" in the documentation

http://laravel.com/docs/master/packages

Notice that there is no longer a workbench command and you need to create your own package structure, as the Laravel creator want to limit the dependency between created packages and the Laravel framework (#ref)


UPDATE: Laravel 5 is now stable and the illuminate/workbench package can be used in a laravel 5 application as I suggested in this post

like image 32
Nicolas Beauvais Avatar answered Sep 22 '22 13:09

Nicolas Beauvais