How to Define Relationships in FilamentPHP - FilamentPHP for Beginners

Special thanks to Hostinger for sponsoring this video. Hostinger is an incredible web hosting provider where you can set up shared hosting, cloud hosting, VPS hosting, email hosting, and SSL certificates. Hostinger has made a name for itself due to its fast load times, simplicity, free domains, and powerful servers. Here’s my affiliate link for 10% off: In this tutorial, we will explore how to define relationships in FilamentPHP. We’ll start by looking at the BrandResource and Brand model, and how to create a one-to-many relationship between products and brands. Then, we’ll move on to the ProductResource and Product model, and learn how to create a many-to-one relationship with brands and a many-to-many relationship with categories. Next, we’ll cover the OrderResource and Order model, and how to handle a situation where a form field’s value depends on another field’s value. Finally, we’ll wrap up by examining the CategoryResource and Category model, and how to create a many-to-many relationship with products. 📚 New Udemy Course If you’re looking to level up your Laravel skills? My new course “Mastering Laravel 10 Query Builder, Eloquent & Relationships“ is the perfect opportunity. Learn the essential tools and techniques for building robust and scalable web applications with Laravel: 💌 Newsletter Sign up for my free weekly email newsletter: 🔥 Resources - Twitter: - Instagram: - Blog: - Patreon: - GitHub: - TikTok: @codewithdary ⌛Timestamps 00:00 - Introduction 00:41 - Products Relationship (BelongsToMany) 05:00 - Brands Relationships (HasMany) 16:00 - Orders Relationship (BelongsTo & HasMany) 24:24 - Categories Relationship (BelongsToMany) 26:56 - Outro #laravel #filamentphp #hostinger #codewithdary
Back to Top