I don't think the snippet from the blade file came through properly?
Jun 26, 2017
3
Level 1
Including php snippet in blade
Is it advisable to include php code in blade files , say xyz.blade.php. The reason I am asking is - I want to do some processing in the blade file before displaying the blade content. For example, I have a function in the controller -
public function index() {
$tasks = Task::orderBy('created_at','dsc')->get();
return view('index',compact('tasks'));
}
And following is the snippet from the blade file:
Please or to participate in this conversation.