// First way ->with()return view('index') ->with('projects', $projects) ->with('tasks', $tasks) // Second way - as an arrayreturn view('index', [ 'projects' => $projects, 'tasks' => $tasks ]); // Third way - the same as second, but with variable$data = [ 'projects' => $projects, 'tasks' => $tasks];return view('index', $data); // Fourth way - the shortest - compact()return view('index', compact('projects', 'tasks'));