-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Colin Viebrock
committed
Jan 30, 2015
1 parent
b749151
commit 4b88f4e
Showing
6 changed files
with
122 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/vendor/ | ||
.DS_Store | ||
/.idea/ | ||
/vendor/ | ||
composer.phar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# laravel5-package-template | ||
# vendor/package | ||
|
||
Boilerplate template for Laravel 5 packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
{ | ||
"name": "cviebrock/laravel5-package-template", | ||
"description": "Boilerplate template for Laravel 5 packages", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Colin Viebrock", | ||
"email": "colin@viebrock.ca" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.4.0" | ||
"name": "vendor/package", | ||
"description": "", | ||
"keywords": [], | ||
"homepage": "", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "", | ||
"email": "" | ||
} | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.4.0", | ||
"illuminate/config": "~5.0", | ||
"illuminate/support": "~5.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Vendor\\Package\\": "src/" | ||
} | ||
}, | ||
"minimum-stability": "dev" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
/** | ||
* Your package config would go here | ||
*/ | ||
|
||
return []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* Your package routes would go here | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php namespace Vendor\Package; | ||
|
||
use Illuminate\Support\ServiceProvider as LaravelServiceProvider; | ||
|
||
class ServiceProvider extends LaravelServiceProvider { | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application events. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() { | ||
|
||
$this->handleConfigs(); | ||
// $this->handleMigrations(); | ||
// $this->handleViews(); | ||
// $this->handleTranslations(); | ||
// $this->handleRoutes(); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() { | ||
|
||
// Bind any implementations. | ||
|
||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() { | ||
|
||
return []; | ||
} | ||
|
||
private function handleConfigs() { | ||
|
||
$configPath = __DIR__ . '/../config/packagename.php'; | ||
|
||
$this->publishes([$configPath => config_path('packagename.php')]); | ||
|
||
$this->mergeConfigFrom($configPath, 'packagename'); | ||
} | ||
|
||
private function handleTranslations() { | ||
|
||
$this->loadTranslationsFrom('packagename', __DIR__.'/../lang'); | ||
} | ||
|
||
private function handleViews() { | ||
|
||
$this->loadViewsFrom('packagename', __DIR__.'/../views'); | ||
|
||
$this->publishes([__DIR__.'/../views' => base_path('resources/views/vendor/packagename')]); | ||
} | ||
|
||
private function handleMigrations() { | ||
|
||
$this->publishes([__DIR__ . '/../migrations' => base_path('database/migrations')]); | ||
} | ||
|
||
private function handleRoutes() { | ||
|
||
include __DIR__.'/../routes.php'; | ||
} | ||
} |