1. Go to this page and download the library: Download manzadey/request-rules-fill 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/ */
manzadey / request-rules-fill example snippets
use Manzadey\RequestRulesFill\RequestRulesFill;
$rules = new RequestRulesFill;
namespace App\Http\Requests\Admin\Article;
use Manzadey\RequestRulesFill\RequestRulesFill;
use Illuminate\Foundation\Http\FormRequest;
class ArticleStoreRequest extends FormRequest
{
public function rules() : array
{
return $this->makeRules()->get();
}
public function makeRules() : RequestRulesFill
{
$rules = new RequestRulesFill();
$rules->fields('show', 'top')->rule('nullable', 'boolean');
$rules->fields('name')->rule('
namespace App\Http\Requests\Admin\Article;
use Illuminate\Validation\Rule;
class ArticleUpdateRequest extends ArticleStoreRequest
{
public function rules() : array
{
return $this->makeRules()->get();
}
public function makeRules() : RequestRulesFill
{
return parent::makeRules()->replaceRule('slug', 'unique:articles', Rule::unique('articles')->ignore($this->route('article')->id));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.