If I want to display user according to there role ..for example. Want to show all admin in a page with there information. How am I going to go about it ..?
Awesome content! Subscribed. Haha. Your video helped me understood this manytomany relationship which I am going to implement in my project. Also, what extension do you use for laravel in browser there?
@@Laratips $employee = \App\Models\Employee::find($id); $seaman->document()->attach($request->document_id,[ 'att_number' =>$request->att_number, 'att_by' =>$request->att_by, 'image' =>$request->iamge, ]); $fileName = time().'.'.$request->attach_file->extension(); $request->attach_file->move(public_path('file_upload'), $fileName); so far i could only manage like this, the image got its name but didnt get attached to DB,
You need to first store the image to the filesystem and then attach it's name. You are doing opposite here. Pass the $imageName to the attach method instead of request. Also, don't forget to add 'image' inside the 'withPivot' method in the model relationship method.
WOW! You are amazing. I love this because its so easy to follow you. :D Do you have a tutorial for tinkerwell? I think this is good for learning, the laravel relations. Please more content ;)