1. Go to this page and download the library: Download alvarofpp/expand-request 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/ */
alvarofpp / expand-request example snippets
// ...
$previousUrl = app('request')->create(url()->previous());
if (is_url('courses/create', $previousUrl)) {
// Do something...
}
namespace App\Http\Requests\Course;
use Alvarofpp\ExpandRequest\Traits\UrlParameters;
use Illuminate\Foundation\Http\FormRequest;
class ShowRequest extends FormRequest
{
use UrlParameters;
// ...
}
// ...
public function rules()
{
return [
'course' => ['
namespace App\Http\Requests\Course;
use Alvarofpp\ExpandRequest\Traits\UrlParameters;
use Illuminate\Foundation\Http\FormRequest;
class ShowRequest extends FormRequest
{
use UrlParameters;
protected $renameUrlParameters = [
'course_id',
'content_id',
'video_id',
];
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'course_id' => ['
namespace App\Http\Requests\Course;
use Alvarofpp\ExpandRequest\Traits\RemoveExtraParameters;
use Illuminate\Foundation\Http\FormRequest;
class ShowRequest extends FormRequest
{
use RemoveExtraParameters;
// ...
}
namespace App\Http\Requests\Course;
use Alvarofpp\ExpandRequest\Traits\RemoveExtraParameters;
use Illuminate\Foundation\Http\FormRequest;
class ShowRequest extends FormRequest
{
use RemoveExtraParameters;
protected $accept = [
'field_1', 'field_2',
];
// ...
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.