Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dees040/persisting-requests
Create persisting requests in Laravel.
https://github.com/dees040/persisting-requests
Last synced: about 4 hours ago
JSON representation
Create persisting requests in Laravel.
- Host: GitHub
- URL: https://github.com/dees040/persisting-requests
- Owner: dees040
- Created: 2017-04-22T11:27:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-06T06:56:46.000Z (about 7 years ago)
- Last Synced: 2024-04-22T19:08:29.533Z (7 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Persisting Requests
This package will let you create persisting requests in a breeze. It will call a persisting method on your request via the Laravel Container, meaning you can use dependency injection. The package is inspired by [this Laracasts video](https://laracasts.com/series/whip-monstrous-code-into-shape/episodes/1). The package can help cleaning up your controller.
## Installation
Install the latest version with composer.
```
composer require dees040/persisting-request
```After installing the packages and the service provider to the `providers` array in `app/config.php`.
```php
dees040\PersistingRequests\ServiceProvider::class,```
## Usage
You can now run the `make:persist` command.
```
php artisan make:persist FooBarRequest
```In your controller you can now add the fresh created request to the method. Laravel will automatically inject in via dependency injection.
```php
persist();return view('home');
}
}
```Now in your request you can add dependencies to the `persisting` method.
```php
activate($this->user());
}
}
```