├── src ├── lang │ └── .gitkeep ├── views │ └── .gitkeep ├── assets │ └── .gitkeep ├── database │ ├── seeds │ │ └── .gitkeep │ └── migrations │ │ └── .gitkeep ├── routes │ └── routes.php ├── config │ └── config.php └── Package │ ├── Commands │ └── FooCommand.php │ └── PackageServiceProvider.php ├── tests ├── .gitkeep ├── PackageTestCase.php ├── Unit │ └── ExampleTest.php └── Feature │ └── ExampleTest.php ├── .gitignore ├── .travis.yaml ├── phpunit.xml ├── composer.json └── README.md /src/lang/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | composer.phar 3 | composer.lock 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /src/routes/routes.php: -------------------------------------------------------------------------------- 1 | 'value', 13 | 14 | ]; 15 | -------------------------------------------------------------------------------- /tests/PackageTestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.travis.yaml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.0 5 | - 7.1 6 | - 7.2 7 | 8 | env: 9 | - LARAVEL_VERSION=5.5.* 10 | - LARAVEL_VERSION=5.6.* 11 | 12 | matrix: 13 | fast_finish: true 14 | exclude: 15 | - php: 7.0 16 | env: LARAVEL_VERSION=5.6.* 17 | 18 | before_script: 19 | - travis_retry composer self-update 20 | - travis_retry composer install --prefer-source --no-interaction 21 | - if [ "$LARAVEL_VERSION" != "" ]; then composer require --dev "laravel/laravel:${LARAVEL_VERSION}" --no-update; fi; 22 | - composer update 23 | 24 | script: 25 | - phpunit -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./tests 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Package/Commands/FooCommand.php: -------------------------------------------------------------------------------- 1 | Replace with your package name <-- 20 | * 21 | * @var string 22 | */ 23 | protected $packageName = 'package'; 24 | 25 | /** 26 | * A list of artisan commands for your package 27 | * 28 | * @var array 29 | */ 30 | protected $commands = [ 31 | FooCommand::class, 32 | ]; 33 | 34 | /** 35 | * Bootstrap the application services. 36 | * 37 | * @return void 38 | */ 39 | public function boot() 40 | { 41 | $this->loadRoutesFrom(__DIR__.'/../routes/routes.php'); 42 | 43 | // Register Views from your package 44 | $this->loadViewsFrom(__DIR__.'/../views', $this->packageName); 45 | 46 | // Regiter migrations 47 | $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); 48 | 49 | // Register translations 50 | $this->loadTranslationsFrom(__DIR__.'/../lang', $this->packageName); 51 | $this->publishes([ 52 | __DIR__.'/../lang' => resource_path('lang/vendor/'. $this->packageName), 53 | ]); 54 | 55 | // Register your asset's publisher 56 | $this->publishes([ 57 | __DIR__.'/../assets' => public_path('vendor/'.$this->packageName), 58 | ], 'public'); 59 | 60 | // Publish your seed's publisher 61 | $this->publishes([ 62 | __DIR__.'/../database/seeds/' => base_path('/database/seeds') 63 | ], 'seeds'); 64 | 65 | // Publish your config 66 | $this->publishes([ 67 | __DIR__.'/../config/config.php' => config_path($this->packageName.'.php'), 68 | ], 'config'); 69 | 70 | if ($this->app->runningInConsole()) { 71 | $this->commands($this->commands); 72 | } 73 | } 74 | 75 | /** 76 | * Register the application services. 77 | * 78 | * @return void 79 | */ 80 | public function register() 81 | { 82 | $this->mergeConfigFrom( 83 | __DIR__.'/../config/config.php', $this->packageName 84 | ); 85 | 86 | } 87 | 88 | } 89 | --------------------------------------------------------------------------------