Laravel since 2014. working with PHP since 2006. team lead on international startups mentored frontend and backend developers SYSTEM-INC.COM TIRIEN.COM
within your package service provider's boot method public function boot() { $this->publishes([ __DIR__.'/path/to/config/my_package_config.php' => config_path('my_package_config.php'), ]); } Values may be accessed like any other con guration le config('my_package_config.some_option'); Con g can be merged with existing one $this->mergeConfigFrom( __DIR__.'/path/to/config/my_package_auth.php', 'auth' );
service provider's boot method public function boot() { $this->loadViewsFrom(__DIR__.'/path/to/views', 'my_package'); } Package views are referenced like this Route::get('admin', function () { return view('my_package::dashboard'); });
service provider's boot method public function boot() { $this->loadMigrationsFrom(__DIR__.'/path/to/migrations'); } When registered like this, they will automatically be run when the command is executed php artisan migrate Sometimes it's better to run package migration from package custom command i.e. instal CLI command
directory write tests for your package use contracts instead of facades - easier to mock clone github repo in vendor/my_package directory we will need one for publishing and releasing
your package to composer publish to packagist, packalyst, or some other package directory that composer can use as repository by default Composer just uses the repository create release on github repo, you will need one for packagist submition you will need to update your packagist repo manualy, or to setup for Packagist composer.json packagist.org GitHub Service Hook