Skip to main content

الحلقة 17# : Many-to-Many using DB in Laravel 5.1

سنتعلم في هذا الدرس كيف نربط الجداول بعلاقة Many-to-Many في الLaravel 5.1 بأستخدام الQuery Builder, والمثال الذي سيطبق في هذا الدرس هو علاقة المؤلفين مع الكتب Authors_Books_Relationship

 في البدء يجب ان تفهم امر مهم جداً وهو ان الكتاب لا وجود له بدون مؤلف او مؤلفين اي قبل ان يتم ادراج كتاب في قاعدة البيانات يجب ان يتم ادراج المؤلفين لهذا الكتاب المؤلف يمكن ان يكتب كتاب او عدة كتب والكتاب يمكن ان يكتُب عن طريق مؤلف او عدة مؤلفين الربط بين هذين الجدولين يحتاج الى جدول يتوسط بينهما يسمى ب Intermediate Table سيحتوي على حلقين اساسين حقل اسمه author_id الذي سيكون بمثابة Foreign key لجدول authors وحقل اسمه book_id الذي سيكون بمثابة Foreign key لجدول books وبهذا اي كتاب يتم انشاءه سيحفظ رقم المؤلف author_id مع رقم الكتابbook_id في هذا الجدول

Comments

Popular posts from this blog

How To Play .srt Subtitles File in Windows Media Player

How To Play .srt Subtitles File in Windows Media Player links: https://sourceforge.net/projects/wmpsub/ wmp,.srt Subtitles File in Windows Media Player,How To Play .srt Subtitles File in Windows Media Player,How To,Safaa Al-Hayali,saf3al2a,srt subtitle in WMP,Windows,Windows Media Player,media,.ass,local subtitles

How to fix the disk is write protected

in this video tutorial, I'll show you how to remove/solve/fix the disk is write protected from USB flash drive. To download the necessary 2 files: Download >  SAFAA_ALHAYALI.IMG  - 1.18 MB Download >  Win32DiskImager-0.9.5-install.exe - 11.7 MB write protection,remove write protection,write protected,How to fix the disk is write protected,how to solve the disk is write protected,how to remove the disk is write protected,USB write protected,fix USB write protected,fix HDD write protected,how to,windows,USB flash drive ERROR,fix USB flash drive write protected,USB flash drive write protected

How To Connect PS4 Controller To a Laptop / PC

How To Connect PS4 Controller To a Laptop / PC Learn how easy it is to connect PS4 wireless controller to your computer (Laptop or PC) either by using Blutooth to pair your controller with the computer or using MicroUSB to USB male cable, but, you have to download a software to change the layout or to map the keys of PS4 to act as XBOX controller........ good luck and enjoy.......... Download the software to map the keys: CLICK HERE TO DOWNLOAD PS4,PS4 Controller,PC,Laptop,saf3al2a,How to,connect ps4 to laptop,ps4 controller to PC,playstation,playstation 4,Safaa Al-Hayali,games on PC