Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class not found FatalErrorException #38

Closed
bsh314 opened this issue Dec 14, 2015 · 3 comments
Closed

Class not found FatalErrorException #38

bsh314 opened this issue Dec 14, 2015 · 3 comments

Comments

@bsh314
Copy link

bsh314 commented Dec 14, 2015

So one of my laravel 5.0.34 projects needs this utility. Installed it throw composer

composer require anlutro/l4-settings

// this adds 'anlutro/l4-settings": "^0.4.5' to composer.json

Added Service Provider & Facade

'providers' => [
    .
    .
   'anlutro\LaravelSettings\ServiceProvider',


'aliases' => [
    .
    .
    'Setting'   => 'anlutro\LaravelSettings\Facade'

All exactly as always and according to README. But my controller goes throw FatalErrorException while trying to use 'Setting' facade.

use Illuminate\Http\Request;
use Artisan;
use Input;

class ConfigController extends Controller {
.
.
.
    public function config(){
        $server = Setting::get('server', 1);    <<<<<<<<   Class 'XXXXX\Http\Controllers\Setting' not found
        $count = Setting::get('count', 1000);
        return view('config')->with(compact('server','count'));
    }

What can it be? Trully rare problem (maybe stupid, but rare)

@bsh314
Copy link
Author

bsh314 commented Dec 14, 2015

use anlutro\LaravelSettings\Facade as Setting;

IS a solution, urgly one, but works.

@anlutro
Copy link
Owner

anlutro commented Dec 14, 2015

If your controller is in a namespace, you have to use Setting - just like you're already doing use Artisan and use Input.

@alexchitoraga
Copy link

Use can use Setting facase as \Setting:: ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants