Tag Archives: laravel

Laravel one-to-many polymorphic relationship

Laravel one-to-many polymorphic relationship

In this article let’s understand Laravel one-to-many polymorphic relationship. Laravel provides many relationship to work with multiple tables and one of them is one-to-many polymorphic relationship. Check below graphics to understand it in simple scenario. What you can see from graphics is one Post can have many Tags as well one Video can also have …

Laravel one-to-one polymorphic relationship

Laravel one-to-one polymorphic relationship

In this article let’s understand Laravel one-to-one polymorphic relationship. Laravel provides many relationship to work with multiple tables and one of them is one-to-one polymorphic relationship. Check below graphics to understand it in simple scenario. What you can see from graphics is one Country can have one Capital as well one State can also have …

Laravel hasOneThrough relationship

Laravel hasOneThrough relationship

In this article let’s understand Laravel hasOneThrough relationship. Laravel provides many relationship to work with multiple tables and one of them is Has One Through relationship. Check below graphics to understand it in simple scenario. What you can see from graphics is one Address will have only Building and one Building will have ony one …

Laravel hasManyThrough relationship

Laravel Has Many Through relationship

In this article let’s understand Laravel hasManyThrough relationship. Laravel provides many relationship to work with multiple tables and one of them is Has Many Through relationship. Check below graphics to understand it in simple scenario. What you can see from graphics is one Country will have many States and one State will have many Cities. …

Laravel many to many relationship

In this article let’s understand many-to-many relationship in Laravel. Laravel provides many relationship to work with multiple tables and one of them is many-to-many relationship. So, when one record of the table is associated with many records of another table but another tables one record will also be associated with many record from first table. …

Laravel one to many relationship

Laravel one to many relationship

In this article let’s understand one-to-many relationship in Laravel. Laravel provides many relationship to work with multiple tables and the very basic one is one-to-many relationship. So, when one record of the table is associated with many records of another table but another tables one record will only be associated with only record from first …

Laravel one to one relationship

Laravel one to one relationship

In this article let’s understand one-to-one relationship in Laravel. Laravel provides many relationship to work with multiple tables and the very basic one is one-to-one relationship. So, when one record of the table is associated with only one record of another table we can define one to one relationship. Check below graphics to understand it …

How to use validations in Laravel

How to use validations in Laravel

In this article lets understand how to use validations in laravel. We can use validations for checking incoming HTTP request before we will actually use them to process. Let’s see below how to do that. You can use validation in laravel with two different ways: 1) In your controller: This method is recommended when you …

How to use localization in laravel multilanguage support

How to use localization in laravel multilanguage support

In this article let’s understand How to use localization in laravel multilanguage support. Let’s understand through steps: Step 1 : Create local files First of all lets create language files at resources/lang/{en.json, fr.json}. Checkout below structure. Configure and check locale at “config/app.php” Step 2 : Create middleware We need to apply this middleware to filter …

How to use HTTP in laravel to make requests

How to use HTTP in laravel to make requests

In this article let’s understand how to use HTTP in laravel to make requests. Please note that this is only available for laravel 7.X versions. Its not available for previous versions. So, laravel introduced this quick and easy to use api to make requests from any other third party. It provides various types of request …