You can easily tell laravel to load a relation with a single command:
$model->load('relation');
Will tell it to refresh the relation collection, and $model->relation
will now show the correct values.
Also unloading a relation will be like this:
$model->unsetRelation('relation')
Related Contents:
- Laravel orderBy on a relationship
- Laravel Eloquent – Attach vs Sync
- Laravel requires the Mcrypt PHP extension
- Could not open input file: artisan
- How to Set Variables in a Laravel Blade Template
- How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?
- PHP Composer update “cannot allocate memory” error (using Laravel 4)
- Laravel Check If Related Model Exists
- Composer killed while updating
- Laravel where on relationship object
- Laravel blank white screen
- Dropping column with foreign key Laravel error: General error: 1025 Error on rename
- How to get all rows (soft deleted too) from a table in Laravel?
- Laravel: Validation unique on update
- Download files in laravel using Response::download
- Laravel: Where to store global arrays data and constants?
- Update without touching timestamps (Laravel)
- Laravel: How to get last N entries from DB
- Laravel 5.1 Unknown database type enum requested
- Get previous attribute value in Eloquent model event
- Laravel Mail::send() sending to multiple to or bcc addresses
- Laravel Escaping All HTML in Blade Template
- How to manually create a new empty Eloquent Collection in Laravel 4
- Composer: required packages with differing levels of minimum-stability
- Laravel Validation one of two fields must be filled
- Using Carbon to return a human readable datetime difference
- Eloquent model mass update
- Laravel “At Least One” Field Required Validation
- Laravel – Check if @yield empty or not
- Install dependency (doctrine/dbal) on composer laravel
- Laravel Eloquent get results grouped by days
- How to check if a folder exists before creating it in laravel?
- Laravel set between digits in validation
- How Follow the Don’t Repeat Yourself Principle When Consuming My Own Laravel API?
- Change name of Laravel’s created_at and updated_at
- Eloquent column list by key with array as values?
- How to create multilingual translated routes in Laravel
- Laravel Eloquent how to use between operator
- Laravel: find out if variable is collection
- Laravel not sending email and not giving errors
- Inserting created_at data with Laravel
- Address in mailbox given [] does not comply with RFC 2822, 3.6.2. when email is in a variable
- Required_if laravel with multiple value
- Laravel Eloquent LEFT JOIN WHERE NULL
- Access query string values from Laravel
- Laravel Eager Loading – Load only specific columns
- Check if name is unique among non-deleted items with laravel validation
- Avoid public folder of laravel and open directly the root in web server
- Why does phpunit not show any errors in the console
- Laravel Eloquent: How to order results of related models?