2017 © Pedro Peláez
 

library laravel-package-service-provider

Service provider for laravel to allow for multiple implementations

image

kevupton/laravel-package-service-provider

Service provider for laravel to allow for multiple implementations

  • Wednesday, March 28, 2018
  • by kevupton
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,041 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 42 % Grown

The README.md

laravel-package-service-provider

Improved service provider functions for handling cross application code., (*1)

Src


<?php /** * Created by PhpStorm. * User: kevin * Date: 3/12/2017 * Time: 6:11 PM */ namespace Kevupton\LaravelPackageServiceProvider; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\ServiceProvider as BaseServiceProvider; class ServiceProvider extends BaseServiceProvider { /** * Registers a configuration * * @param string $path * @param string $name */ protected function registerConfig ($path, $name) { $this->publishes([__DIR__ . $path => config_path($name)]); } /** * Determines whether this application is an instance of Lumen * * @return bool */ protected function isLumen () { return is_a($this->app, 'Laravel\Lumen\Application'); } /** * Determines whether this application is an instance of Laravel * * @return bool */ protected function isLaravel () { return is_a($this->app, 'Illuminate\Foundation\Application'); } /** * Register Alias function to register an alias based upon * whether they are using lumen or laravel * * @param string $class * @param string $name */ protected function registerAlias ($class, $name) { if ($this->isLaravel()) { AliasLoader::getInstance()->alias($name, $class); } elseif ($this->isLumen()) { if (!class_exists($name)) { class_alias($class, $name); } } } }

The Versions

28/03 2018

dev-master

9999999-dev

Service provider for laravel to allow for multiple implementations

  Sources   Download

The Development Requires

by Kevin Upton

28/03 2018

v0.0.5

0.0.5.0

Service provider for laravel to allow for multiple implementations

  Sources   Download

The Development Requires

by Kevin Upton

24/03 2018

v0.0.4

0.0.4.0

Service provider for laravel to allow for multiple implementations

  Sources   Download

The Development Requires

by Kevin Upton

22/01 2018

v0.0.3

0.0.3.0

Service provider for laravel to allow for multiple implementations

  Sources   Download

The Development Requires

by Kevin Upton

03/12 2017

v0.0.2

0.0.2.0

Service provider for laravel to allow for multiple implementations

  Sources   Download

The Development Requires

by Kevin Upton

03/12 2017

v0.0.1

0.0.1.0

Service provider for laravel to allow for multiple implementations

  Sources   Download

The Development Requires

by Kevin Upton