Hi, I have this code in my controller:
public function store(Request $request)
{
$user = Auth::user();
if ($user->can('admin')) {
$p = Product::create($request->all());
return redirect('products')->with(['message' => 'Prodotto salvato!', 'alert-class' => 'alert-success']);
}
return redirect('/')->with(['message' => 'Non hai i permessi!', 'alert-class' => 'alert-danger', 'user' => $user]);
}
on my dev machine works like a charm, in production product is saved but thenI get logged out. In my session table I see many rows with my IP but null as user_id (ofc if I log in again, there is also a row with my ID). Any idea what can cause this?
Thanks a lot
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community