Init(Core): Change repo
This commit is contained in:
23
app/Http/Requests/AuthRequest.php
Normal file
23
app/Http/Requests/AuthRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AuthRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'mobile' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
26
app/Http/Requests/BookRequest.php
Normal file
26
app/Http/Requests/BookRequest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class BookRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'volum_id' => 'required',
|
||||
// 'book_id' => 'required',
|
||||
'per_page' => 'nullable|numeric',
|
||||
'page' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
}
|
||||
26
app/Http/Requests/ChapterRequest.php
Normal file
26
app/Http/Requests/ChapterRequest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ChapterRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
return [
|
||||
'book_id' => 'required',
|
||||
'per_page' => 'nullable|numeric',
|
||||
'page' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/CheckBookFilterRequest.php
Normal file
34
app/Http/Requests/CheckBookFilterRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CheckBookFilterRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'category_id' => 'nullable',
|
||||
'book_id' => 'nullable',
|
||||
'volume_id' => 'nullable',
|
||||
'division_id' => 'nullable',
|
||||
'section_id' => 'nullable',
|
||||
'part_id' => 'nullable',
|
||||
'gate_id' => 'nullable',
|
||||
'law_id' => 'nullable',
|
||||
'chapter_id' => 'nullable',
|
||||
'branch_id' => 'nullable',
|
||||
'per_page' => 'nullable',
|
||||
'art_id' => 'nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
32
app/Http/Requests/CheckBookRequest.php
Normal file
32
app/Http/Requests/CheckBookRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CheckBookRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'book_id' => 'nullable',
|
||||
'volume_id' => 'nullable',
|
||||
'division_id' => 'nullable',
|
||||
'section_id' => 'nullable',
|
||||
'part_id' => 'nullable',
|
||||
'gate_id' => 'nullable',
|
||||
'law_id' => 'nullable',
|
||||
'chapter_id' => 'nullable',
|
||||
'branch_id' => 'nullable',
|
||||
'per_page' => 'nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
app/Http/Requests/GetApiRequest.php
Normal file
23
app/Http/Requests/GetApiRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GetApiRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'book_id' => 'required'
|
||||
];
|
||||
}
|
||||
}
|
||||
25
app/Http/Requests/SectionRequest.php
Normal file
25
app/Http/Requests/SectionRequest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SectionRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'book_id' => 'required',
|
||||
'per_page' => 'nullable|numeric',
|
||||
'page' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/SuggestionRequest.php
Normal file
31
app/Http/Requests/SuggestionRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SuggestionRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'text' => 'required'
|
||||
];
|
||||
}
|
||||
}
|
||||
24
app/Http/Requests/VersionRequest.php
Normal file
24
app/Http/Requests/VersionRequest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class VersionRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'required|in:ios,web,android',
|
||||
'number' => 'required|integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
25
app/Http/Requests/VolumRequest.php
Normal file
25
app/Http/Requests/VolumRequest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Traits\FailValidation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class VolumRequest extends FormRequest
|
||||
{
|
||||
use FailValidation;
|
||||
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'law_id' => 'required',
|
||||
'per_page' => 'nullable|numeric',
|
||||
'page' => 'nullable|numeric',
|
||||
];
|
||||
}
|
||||
}
|
||||
24
app/Http/Requests/admin/CreateVersionStore.php
Normal file
24
app/Http/Requests/admin/CreateVersionStore.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateVersionStore extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'code' => 'required',
|
||||
'number' => 'required',
|
||||
'log' => 'required',
|
||||
'force_update' => 'nullable',
|
||||
'type' => 'required'
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/admin/Notification/StoreRequest.php
Normal file
21
app/Http/Requests/admin/Notification/StoreRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\Notification;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'required|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/admin/Notification/UpdateRequest.php
Normal file
21
app/Http/Requests/admin/Notification/UpdateRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\Notification;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'title' => 'required|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/admin/SubscribePlan/CreateRequest.php
Normal file
34
app/Http/Requests/admin/SubscribePlan/CreateRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\SubscribePlan;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string',
|
||||
'price' => 'required|numeric',
|
||||
'expired_day' => 'required|integer',
|
||||
'is_active' => 'nullable',
|
||||
'is_free' => 'nullable',
|
||||
'type' => 'nullable',
|
||||
'transaction' => 'nullable'
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/admin/SubscribePlan/UpdateRequest.php
Normal file
34
app/Http/Requests/admin/SubscribePlan/UpdateRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\SubscribePlan;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string',
|
||||
'price' => 'required|numeric',
|
||||
'expired_day' => 'required|integer',
|
||||
'is_active' => 'nullable',
|
||||
'is_free' => 'nullable',
|
||||
'type' => 'nullable',
|
||||
'transaction' => 'nullable'
|
||||
];
|
||||
}
|
||||
}
|
||||
24
app/Http/Requests/admin/UpdateVersionStore.php
Normal file
24
app/Http/Requests/admin/UpdateVersionStore.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateVersionStore extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'code' => 'required',
|
||||
'number' => 'required',
|
||||
'log' => 'required',
|
||||
'force_update' => 'nullable',
|
||||
'type' => 'required'
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/admin/category/CreateCategoryRequest.php
Normal file
21
app/Http/Requests/admin/category/CreateCategoryRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\category;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'label' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/admin/category/UpdateCategoryRequest.php
Normal file
21
app/Http/Requests/admin/category/UpdateCategoryRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\category;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateCategoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'label' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
app/Http/Requests/admin/user/CreateUserRequest.php
Normal file
23
app/Http/Requests/admin/user/CreateUserRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\user;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateUserRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|unique:users',
|
||||
'mobile' => 'required|unique:users',
|
||||
'is_admin' => 'nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
app/Http/Requests/admin/user/UpdateUserRequest.php
Normal file
23
app/Http/Requests/admin/user/UpdateUserRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\admin\user;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateUserRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|unique:users',
|
||||
'mobile' => 'required|unique:users',
|
||||
'is_admin' => 'nullable',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user