skip to Main Content

Pass variable to view via controller in Laravel

I need help with passing the variable I have initialized using __construct() to view in Laravel. Here is my controller code protected $profileInfo; public function __construct(){ $this->profileInfo = Profile::with('address')->where('id', '=', '1')->get(); } public function index(){ $this->profileInfo; return view('admin_pages.profile', compact('profileInfo')); }…

VIEW QUESTION

laravel leftjoin on json

I have Raw query running as select meeting.id, GROUP_CONCAT(users.name separator " | ") AS present_user_id from `meeting` left join `users` on JSON_CONTAINS(meeting.present_user_id, JSON_ARRAY(users.id), '$') group by `meeting`.`id` Which provide proper result, I tried to convert same in Laravel 8 like…

VIEW QUESTION
Back To Top
Search