I have this code in my laravel blade :
@if(Auth::check())
<form
id="fileUploadForm"
method="POST"
action="{{route('scanningUpload',['user'=>Auth::user()->id,'person'=>$person->id])}}"
enctype="multipart/form-data"
>
@else
<p> do some thing </p>
but now I got this error:
Attempt to read property "id" on null for Auth::user()->id
How can I fix it?