laravel 4.1模型中的自定义方法不起作用

I am trying to use custom method in User model with class name User in laravel4.1. i changed the $table attribute to my table name and added a custom method names 'public function abc' in user model. Then in my user controller i tried like this :-

$u= new User; $u->abc();

but its not working and giving following error :-

BadMethodCallException Call to undefined method Illuminate\Database\Query\Builder::abc()

and i dnt know why this happening everything seems fine,help me out in this guys.

UPDATE :SOLVED ,Done Nothing I DO NOT KNOW WHAT IS THE PROBLEM WITH LARAVEL $u= new user; $u->abc();

i just changed User to user and its started working and i dnt even know why ,anyone know reason??

Every method on a Model get passed on to a new QueryBuilder

User::where()
User::find()
User::{relationship}()

If you instantiate a model like this

$user = User::find()->method();

it will work. Don't try to make your Eloquent models too fat. Just create a Repository to make your Controllers as thin as possible and your Eloquent just as intelligent as it can be by using the tools given by Eloquent (relationships, hidden attributes, accessors & mutators, $this->appends, ...)

Everything else belongs in your Repositories.

Try running

composer dumpautoload

If this doesn't work, be sure that there is only one class called User in your whole project. There may be a package, migration or something with the same name. Try putting your custom User class in a namespace.