you must use static function for this
public static function getId($name)
{
........
}
also you can use dependency injection for controller like this controller
class SiteController{
protected $model;
public function __construct(Site $site)
{
$this->model = $site;
}
public function index()
{
$all = $this->model->all();
}
}
So as far as i understood all methods in models should be static?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community