У нас вы можете посмотреть бесплатно Part 39 - Deleting Tags Safely [How to Build a Blog with Laravel 5 Series] или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Deleting many-to-many relationships in Laravel 5.2 means that we must use a special detach() method before deleting the resource itself. This tutorial will show you how it works. In previous videos we worked on our Tags model and the CRUD involved with it. We set up our pivot table to track the relationship between tags and posts. Tags have many posts and posts have many tags. Simple stuff. But deleting these relationships can be difficult. We can't simply delete the tag because then the posts will still be looking for the tag, but will get an error because the tag does not exist. If a post is removed, then the tags will point to posts that do not exist. So we must modify the delete methods for both posts and tags to make sure that these links between tags and posts are deleted when a resource is deleted to reflect the new structure. We will use the detach() method to remove these links before deleting the resource. This method makes our jobs easy because it does all the hard work. It removes all the links for the resource we are deleting. If we run it on a post object then it will remove all the links to posts equal to the one we are deleting from the table. If we run it on a tag object then it will remove all links for that tag from the post_tag table. Slick stuff. Coming Up: Starting the comment system -- DOWNLOAD SOURCE CODE -- https://github.com/jacurtis/laravel-b... -- CODE SNIPPETS -- detach() -- MORE FROM THIS SERIES -- Previous Video [Part 38]: • Part 38 - Show, Edit, Update our Tags [How... Next video [Part 40]: • Part 40 - Sending Email from Contact Form ... 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. Best tut about Laravel. Build a blog with Laravel Tutorial. Beginner tutorial. How to video. PHP framework easy best tutorial. Laravel 5 coding in PHP with Alex.