Esempio n. 1
0
 public function update(Parcels $parcel, Request $request)
 {
     // Limit updating to only admins, and not just anyone
     $this->validate($request, ['description' => 'required', 'weight' => 'required|integer', 'destination' => 'required']);
     // Uncomment and modify if you need to validate any input.
     $parcel->update($request->all());
     $request = null;
     event(new ActivityLog(auth()->user()->username . ' edited the parcel ' . $parcel->description . ' with the code ' . $parcel->code . ' successfully.'));
     alert()->success('Parcel updated successfully', 'Success');
     return redirect('parcel/' . $parcel->id);
 }