This repository contains a collection of Laravel Eloquent models and migrations showcasing various types of relationships within the Laravel framework. Whether you're new to Laravel or looking for a quick reference on implementing relationships, this repository provides clear and concise examples.
- One-to-One Relationships:
- One-to-Many Relationships:
- Many-to-One Relationships:
- Many-to-Many Relationships:
- Laravel installed on your machine.
-
Clone the repository:
git clone https://github.com/SadiaRidita/laravel-eloquent-relationships.git
-
Navigate to the project directory:
cd laravel-eloquent-relationships
-
Install dependencies:
composer install
-
Run migrations:
php artisan migrate
Explore the various relationship examples in the app
directory. Each model is accompanied by a migration file, providing a clear structure for understanding and implementing relationships.