Complete the code to cache a view in Laravel.
return view('[1]');
The view() function loads a Blade template by its name, such as 'welcome'.
Complete the command to cache all views in Laravel.
php artisan [1]The php artisan view:cache command compiles and caches all Blade views for faster loading.
Fix the error in the command to clear cached views.
php artisan [1]The correct command to clear cached views is php artisan view:clear.
Fill both blanks to create a cached view with data.
return view('[1]')->with('[2]', $data);
This code returns the 'dashboard' view and passes data under the key 'user'.
Fill all three blanks to cache a view with a condition.
return view('[1]')->with('[2]', $data)->when($data->count() [3] 0, fn() => cache()->remember('view_cache', 60, fn() => $data));
This code returns the 'reports' view with 'items' data and caches it if the count is greater than 0.
