1. Go to this page and download the library: Download dees040/persisting-requests library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Http\Controllers;
use App\Http\Requests\FooBarRequest;
class ActivationController extends Controller
{
public function activate(FooBarRequest $request)
{
$request->persist();
return view('home');
}
}
namespace App\Http\Requests;
use dees040\PersistingRequests\PersistingRequest;
class FooBarRequest extends PersistingRequest
{
/**
* Persist the request.
*
* @return void
*/
public function persisting(ActivationManager $manager)
{
$manager->activate($this->user());
}
}
php artisan make:persist FooBarRequest
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.