PHP code example of aesen / laravel-auto-request

1. Go to this page and download the library: Download aesen/laravel-auto-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/ */

    

aesen / laravel-auto-request example snippets


config/auto-request.php

return [
    'language' => 'tr',

    'rules' => [
        'store' => [
            ' ],

    'messages' => [
        'tr' => [
            '   'en' => [
            '

$table->string('title')->unique();
$table->text('body');
$table->foreignId('category_id');
$table->boolean('active')->nullable();

'title' => ['' => ['ble', 'boolean'],

'title' => ['sometimes', 'string', 'unique:posts,title,$this->route("id")'],
'body' => ['sometimes', 'string'],
'category_id' => ['sometimes', 'integer', 'exists:categories,id'],
'active' => ['nullable', 'boolean'],

'title..unique'   => 'Title daha önce kullanılmış.',
bash
php artisan vendor:publish --tag=auto-request-config
text
app/Http/Requests/Post/
├── StorePostRequest.php
└── UpdatePostRequest.php