How create package in Laravel 5?

后端 未结 3 1279
孤独总比滥情好
孤独总比滥情好 2020-12-14 07:20
php artisan workbench vendor/package --resources

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

3条回答
  •  既然无缘
    2020-12-14 07:38

    In Laravel, these are some handy tricks I follow each time I need to create a Laravel package

    • Solution 1: Get a boilerplate template from https://github.com/cviebrock/laravel5-package-template, and put it under packages/ (follow the instruction in the repo)

    • Solution 2: Use a packager (with Laravel >= 5.5)

      • Install packager it as dev dependency > composer require jeroen-g/laravel-packager --dev (check instruction in the repo here)
      • create the package > composer require jeroen-g/laravel-packager --dev etc, see full tuto
      • then, we have a choice to keep the package in our project, or just remove it by rollingback composer.json

    Hope this is a good update for Laravel lovers ;)

提交回复
热议问题