my code in HomeController.php is
//function to register new issue
public function registerNewIssue(Request $request){
$issue = new bookIssue();
$bookIssued = Library::find($request -> issuedBook);
$issue -> name = $request -> issuedName;
$issue -> bookName = $request -> issuedBook;
$issue -> dateIssued = $request -> issuedDate;
$issue -> dateReturn = $request -> returnDate;
$bookIssued -> Availability = "issued";
$issue -> save();
$data = User::all();
return view('page.RegisterIssues' , compact('data'));
}
The idea is to find the issuedBook from the bookIssued model and update the Availability column to "issued". When i submit the form, its shown an error
Attempt to assign property "Availability" on null
I've follow some answer from here but the error still persist