Access Model from Controller - Laravel 4

eloquent, laravel, laravel-4, mysql, php

Solution

I think Config is a reserved keyword used by laravel to manage config files, so please try changing the model name to something else

Problem

I am a newbie to Laravel. Please excuse me if this question sounds kiddish. I have a model ``` class Config extends Eloquent { public static $table = 'configs'; } ``` and the controller goes as ``` class UserController extends BaseController { Public function getIndex () { $config_items = Config::all (); var_dump ( $config_items ); return View::make ( 'user.userindex' ) -> with ( 'title', 'User Page' ); } } ``` But when i try to access the Config model, i am getting the error: Symfony \ Component \ Debug \ Exception \ FatalErrorException Call to undefined method Illuminate\Config\Repository::all() Please help! I know this question could help many Laravel 4 newbies like me and my co-workers, so please help!

Original source