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

PART #2: Registration and Login System Tutorial Using PHP and MYSQL

PART #2: Registration and Login System Tutorial Using PHP and MYSQL Registration and login system using PHP and MySQL database, in this part you will do the following: 1- Creating the registration page. 2- Validating the registration form. 3- Sending the activation link on successful registration. note: you can find the mailserver tool here: [MailServerTool] Good luck. PHP,Mysql,Programming,web development,How to,Technology,web programming,web project ideas,safaa al-hayali,saf3al2a,Registration and login,Registration and login in php,php and mysql login system,registration system using php and mysql,login and register php,login and register php with database,database,php tutorial,learn php,tutorial

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

Virtual Box : How to Increase Disk Size - Windows

How to increase disk size or disk storage in oracle virtual box the command you have to use: vboxmanage.exe modifymedium "[YourPathToVdiFileOfYourVirtualMachine]" --resize [NUMBER] virtual,box,vbox,oracle,partition,size,disk,increase,resize,windows,10,microsoft,vdi,vboxmanage,configuration,Safaa AL-Hayali,saf3al2a,Oracle,VirtualBox,How to,windows 10