ERROR The hint here is ‘Collection‘… If somehow you got this error while you have check all code is ok, relationship is ok, then try to check either you use first() or get() method. Supposedly you use first() instead of get() method as get() method will return a collection() while first() just return a record.…
error
-
-
Instead of @if(session(‘error’)) <div class=”alert alert-danger”> {{session(‘error’)}} </div> @elseif(session(‘success’)) <div class=”alert alert-success”> {{session(‘success’)}} </div> @endif Do like this @foreach($errors->all() as $error) <p class=”alert alert-danger”>{{ $error }}</p> @endforeach @if(session(‘status’)) <div class=”alert alert-success”> {{ session(‘status’) }} </div> @endif Or <div class=”alert alert-danger”> <ul> @foreach($errors->all() as $error) <li>{{$error}}</li> @endforeach </ul> </div> In controller return redirect()->back()->with(‘status’,’Process is successfully done!’);…