SyntaxFix
Write A Post
Hire A Developer
Questions
You can give like this
public static function getAll() { return $posts = $this->all()->take(2)->get(); }
And when you call statically inside your controller function also..