У нас вы можете посмотреть бесплатно Part 35 - Building Our Tag Model [How to Build a Blog with Laravel 5 Series] или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Now that we understand Many-To-Many Relationships, its time to implement them into our project. In this video we will be building a tag model and connecting it into our posts model so that Laravel understands its' many-to-many status. We must first build our tag model and create a database table for our tags. Our database structure will simply consist of the name of the tag, a primary id, and timestamps. Once we have completed our tags model then we can connect it to our post model. Just like last time, we want to go into our posts model and create a new public function and tell it belongsToMany('App\Tag'); This tells laravel that our posts have many tags. Now we must do the inverse and tell Laravel that our Tags have many posts. To do this, we make the same statement we did in our post model, but we do it in our tag model. Remember to point to the post model this time and not the tag model again. So it should look like belongsToMany('App\Post'); Now they know their relationship. In the next few videos we will work on the CRUD for tags and implement them with our posts so we can use them throughout the app. Coming Up: We add CRUD to our Tags and implement them into our posts. -- CODE SNIPPETS -- Many to Many Relationship belongsToMany('App\Post'); -- MORE FROM THIS SERIES -- Previous Video [Part 34]: • Part 34 - Many to Many Relationships [How ... Next video [Part 36]: Coming Soon Full Playlist for the "How to Build a Blog with Laravel" Series: • How to Build a Blog with Laravel -- FOLLOW ME -- Subscribe for New Releases! Twitter - / _jacurtis (ask me questions!) -- QUESTIONS? -- Leave a comment below and I or someone else can help you. For quick questions you may also want to ask me on Twitter, I respond almost immediately. Email me hello@jacurtis.com Thanks for all your support! --- Tags: Laravel 5.2 Framework Tutorial Easy to learn. Models for Many to many relationships how to use relationships. Mysql rocks. Blog tutorial how to learn. Best tutorial for Laravel relationships. BelongsToMany();