I really love laracast because even though I've been using laravel for 3 years, I still learn new things and tips in this series. Great job!
@i.t.starters20199 ай бұрын
Definitely, me too, I've been doing laravel for over 3 years but I've never really known how relationships, pivot tables actually work, and now I feel like a beginner 😅
@MrLaxr-op4be3 ай бұрын
Hi, your tutorials are great and the thing you did on the computer after saying "I'll see you then" was beyond expectations. Cool !
@GilbertKarogoKabui4 ай бұрын
Wow you really make it easy to understand compared to other sources. Continue the good work.
@funkyjammaclips28 күн бұрын
I have been trying for hours and even after adding PRAGMA foreing_keys=on it still will not delete the pivot table
@edorourke92237 ай бұрын
FYI - Tried the rollback and migration in the VSC terminal, and got the following error: "The token '&&' is not a valid statement separator in this version." Tried again in the cmd window and it was fine
@Cellohhh5 ай бұрын
You saved me, thanks!
@SatoKazumaLvl9 ай бұрын
Pheww. Everytime I finish an episode I feel like I level up 10 times
@diegosk8zero9 ай бұрын
Laravel is life
@axljoven9847 ай бұрын
Hi! Should pivot table names singular? e.g., job_tag instead of job_tags? I encountered a constraint violation error when I unknowingly job_tags.
@renatofrota6 ай бұрын
the convention for pivot tables is to name it accordingly to the model names (singular_singular), in alphabetical order. so a pivot for Posts (model Post) and Categories (model Category) would be category_post.
@axljoven9846 ай бұрын
@@renatofrota I see. That makes sense. Thanks!
@ShahidHussain-ew2bl3 ай бұрын
very nice 💞
@jerryjohnson51408 ай бұрын
I've been debugging for some hours. I've checked and rechecked my code, but seems like my pivot table relationship is not similar as yours. Mine don't have the primary key for the job_listing_id and the tag_id
@jerryjohnson51408 ай бұрын
5:57
@wuba69778 ай бұрын
@@jerryjohnson5140 Is just a structure but basically when you do $table->foreignIdFor(Model Class) which is in the video is Job::class, after migration, the column will be like this job_id, but since sir Jeffrey override it, it became like this job_listing_id. if you're inside job_tags table, the job_listing_id and tag_id are FK not PK. Maybe I miss something. You can reply your problem here so that others can also answer.
@jeremymattausch22187 ай бұрын
I'm gonna guess you fixed that already, but if not : It probably comes from your migration "create_tags_table" where he puts 2 create in there (4:43 timestamp). This is what generates the fields in the DB if I'm not mistaken. If you've got it already, did you migrate:refresh ? If you did, did you CTLR + R while on TablePlus to refresh the DB tables/fields ? Cheers
@paulholsters79326 ай бұрын
Really good video's. But I prefer edgeDB when it comes to relationships (and ORM's in general). So much simpler. So much less code to write! Just learning Laravel to get a job.
@sale76805 ай бұрын
❤❤❤
@brothercaleb9 ай бұрын
Awesome
@jeremymattausch22187 ай бұрын
There is a little something I have trouble understanding. You write, as relatedPivotKey and foreignPivotKey (in the Job/Tag models) for it to be "job_listing_id". Whereas, in your database (and everywhere else), it's clearly written "job_listings_id" with an "S" at listing. How come your query works with the table name not matching ? I tried without the S myself and it trhew an error not finding "job_listing_id" (which is normal, since in my database, just like yours, it's "job_listings_id" instead.
@renatofrota6 ай бұрын
the table name is "job_listings" (it is what it represents: a collection of job listings) as like the "tags" table is a collection of tags. the other hand, the columns at the pivot table job_tag holds the id of a particular listing (job_listing_id, in singular form) and the id of a particular tag (tag_id, also in singular form).