This is simply to demonstrate the problem with calling eloquent refresh()
on a model with specified columns and related models.
Follow these steps to set up and run the example application:
Ensure you have Composer and PHP installed on your system. This project was built using Laravel, which requires PHP >= 7.3 and a compatible Composer version.
-
Clone the repository to your local machine:
git clone https://github.com/anabeto93/Laravel-11-Refresh-Issue
-
Navigate to the project directory:
cd path-to-your-project
-
Install dependencies:
composer install
-
Create an
.env
file from the example file. You may need to adjust database connection settings in.env
:cp .env.example .env
-
Generate an application key:
php artisan key:generate
-
Run migrations and seed the database:
php artisan migrate:refresh --seed
Serve the application using the following Artisan command:
php artisan serve --port=2011
Visit http://localhost:2011/api/refresh
The code for this can be found in the routes/api.php
file.