<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elegantmedia / laravel-simple-repository example snippets
php
php artisan make:repository Car
// this will create
app/Models/CarsRepository.php
php
// overwrite existing file
php artisan make:repository Car --force
// change the default directory to `Entities`
php artisan make:repository Car --dir Entities
php
// change default associated model
php artisan make:repository Car --model Vehicles\\SuperCar
php
php artisan make:repository Car --group
// command
php artisan make:repository Car --dir Entities --group
// file structure (Car.php is an example and created by this command)
app/Entities/Cars/CarsRepository.php
app/Entities/Cars/Car.php
namespaceApp\Models;
useElegantMedia\SimpleRepository\SimpleBaseRepositoryasBaseRepository;
classUsersRepositoryextendsBaseRepository{
// bind the model to the Repositorypublicfunction__construct(User $model){
parent::__construct($model);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.