Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Viebrock committed Jan 30, 2015
1 parent b749151 commit 4b88f4e
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/vendor/
.DS_Store
/.idea/
/vendor/
composer.phar

3 changes: 2 additions & 1 deletion README.md
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
37 changes: 25 additions & 12 deletions composer.json
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"
}
7 changes: 7 additions & 0 deletions config/packagename.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Your package config would go here
*/

return [];
5 changes: 5 additions & 0 deletions routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

/**
* Your package routes would go here
*/
79 changes: 79 additions & 0 deletions src/ServiceProvider.php
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';
}
}

0 comments on commit 4b88f4e

Please sign in to comment.