dimanche 31 juillet 2016

laravel 5 service provider not working my web server

Laravel 5 service provider cannot working in web server but its working fine in my localhost details explain bellow

App->Privider->MymoduleServiceProvider

namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App;
class MyModuleServiceProvider extends ServiceProvider
{
    public function boot()
    {
        //
    }
    public function register()
    {
         App::bind('mymodule', function()
        {
            return new \App\Module\MyModule;
        });
    }
}

I have make one folder named Module in this folder have two file

App->Module

1. MyModule.php

namespace App\module;
use Session;
class MyModule {

public function Vegitable($data){
          $veg = \App\models\veg::select('id')
                  ->where('vegs', $data)
                  ->get()->count();
          echo $veg;
      }
}

2. MyModuleFacade.php

namespace App\Module;
use Illuminate\Support\Facades\Facade;
class MyModuleFacade extends Facade{
    protected static function getFacadeAccessor() { return 'mymodule'; }
}

and i added in config->app.php

'providers' => [
     App\Providers\MymoduleServiceProvider::class
]
 'aliases' => [
    'MyModule'=> App\module\MyModuleFacade::class,
]

and calling in view like

its working fine in my localhost(xampp) but not working my web server geting error message given bellow

ErrorException in AliasLoader.php line 66:
Class 'App\module\MyModuleFacade' not found (View: /home/pric/public_html/veg/demo/vegster/resources/views/veglist.blade.php)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire