My handleInertiaRequest.php
public function share(Request $request): array
{
return [
...parent::share($request),
'ziggy' => fn () => [
...(new Ziggy)->toArray(),
'location' => $request->url(),
],
'user' => Auth::user() ? [
'user' => [
'username' => Auth::user()->username,
'email' => Auth::user()->email,
]
] : null,
'messages' => flash()->render('array'),
'categories' => [
'all' => Category::all(),
]
];
}
My cController :
public function destroy(Capsule $capsule)
{
if ($capsule->preview) {
Storage::disk('public')->delete($capsule->preview);
}
$capsule->delete();
flash()->success('User created.');
return Redirect::route('dashboard');
}
I follow exactly the tutorial in library docs ... i dont know why the watch() method dont respond .... ?