Trying to save an input into my database called requests
The error points to my requestController.php when the data is trying to be saved.This is the code to handle saving the data into the database called requests.
$request = new Request;
These are the data trying to save:
$request->product_name = $posted['product_name'];
$request->product_description = $posted['product_description' ];
$request->email = $posted['email'];
$request->user_id = Auth::user()->I'd;
error reporting from this code:
$request->save();
Why do I get this error exception?
Request is the name of a facade in Laravel. That's why the error message says it's looking for the save() method on the Illuminate\Support\Facades\Request class. You'll want to either namespace your Request class or rename it to something else. I would prefer the latter option, myself.
Besides that, this line looks like it should cause the script to crash: $request->user_id = Auth::user()->I'd; - it should probably be ->id;, I assume?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With