public function index(TabRepository $repository)
{
return inertia()->render('Index', [
'default_tab' => fn () => $repository->getDefaultTabData(), // отдаст по умолчанию и по требованию
'tab2' => Inertia::lazy(fn () => $repository->getTab2Data()), // отдаст только по требованию
'tab3' => Inertia::lazy(fn () => $repository->getTab3Data()), // отдаст только по требованию
]);
}
<Link class="tab" href="route('blabla')" :only="['default_tab']">default_tab</Link>
<Link class="tab" href="route('blabla')" :only="['tab2']">tab2</Link>
<Link class="tab" href="route('blabla')" :only="['tab3']">tab3</Link>
return inertia()->render('Some/Component', ['some' => 'data'])
form.reset()
.Route::fallback(function ()
{
return redirect()->to('/');
});
/app/Exceptions/Handler.php
/**
* Render an exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($e instanceof NotFoundHttpException) {
return redirect()->to('/');
}
return parent::render($request, $e);
}
public function handle($request, Closure $next)
{
if(! in_array($request->route()->getName(), ['home', 'pages'])) {
return redirect()->route('home');
}
return $next($request);
}
<link rel="apple-touch-icon" />
или <link rel="icon" />
.img src
.