I've created a service provider called \App\Providers\HelperServiceProvider.php
with this content:
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Session;
use View;
class HelperServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
foreach (glob(app_path().'/Helpers/*.php') as $filename){
require_once($filename);
}
}
}
And also included in providers
in \config\app.php
This works fine until recently I wanted to add a new provider for different purposes. So I created a new one App\Providers\ComposerServiceProvider.php
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Session;
use View;
class ComposerServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
# This content doesn't really matter. It still doesn't work even if I remove it.
# View composer for partials.alert
# Some code
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
}
}
And included in the config too so it looks like this:
<?php
/* ^Some other things
*
* Application Service Providers...
*/
'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',
'App\Providers\HelperServiceProvider',
'App\Providers\ComposerServiceProvider',
But it came out as Internal Server Error. It works fine when I take out from the providers config. I've tried everything I can think of. I tried removing everything inside boot(), changing the order of the providers, renaming the providers, but none of them worked. I can't get to the php/apache log file for other technical reason. Is there any problem with this implementation that I missed?