how to call a model function inside the controller in laravel 5