api code global jain
This commit is contained in:
32
app/Http/Requests/Api/Chaturmas/GetChaturmasRequest.php
Normal file
32
app/Http/Requests/Api/Chaturmas/GetChaturmasRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Chaturmas;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GetChaturmasRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'page' => 'integer',
|
||||
'limit' => 'integer',
|
||||
'sant_id' => 'required|exists:sants,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
45
app/Http/Requests/Api/Chaturmas/StoreChaturmasRequest.php
Normal file
45
app/Http/Requests/Api/Chaturmas/StoreChaturmasRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Chaturmas;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreChaturmasRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'exists:sants,id',
|
||||
'sagh_id' => 'exists:sanghs,id',
|
||||
'place' => 'nullable',
|
||||
'year' => 'required|exists:chaturmas_dates,id|date_format:Y',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function message()
|
||||
{
|
||||
return [
|
||||
'year.exists' => 'Chaturmas already exist for selected year.',
|
||||
];
|
||||
}
|
||||
}
|
||||
45
app/Http/Requests/Api/Chaturmas/UpdateChaturmasRequest.php
Normal file
45
app/Http/Requests/Api/Chaturmas/UpdateChaturmasRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Chaturmas;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateChaturmasRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'exists:sants,id',
|
||||
'sagh_id' => 'exists:sanghs,id',
|
||||
'place' => 'nullable',
|
||||
'year' => 'required|exists:chaturmas_dates,id|date_format:Y',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function message()
|
||||
{
|
||||
return [
|
||||
'year.exists' => 'Chaturmas already exist for selected year.',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\ChaturmasReview;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreChaturmasReviewRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'required|exists:sants,id',
|
||||
'comment' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\ChaturmasReview;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateChaturmasReviewRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Api/FriendRequest/StoreFriendRequest.php
Normal file
31
app/Http/Requests/Api/FriendRequest/StoreFriendRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\FriendRequest;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreFriendRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'receiver_id' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
32
app/Http/Requests/Api/FriendRequest/UpdateFriendRequest.php
Normal file
32
app/Http/Requests/Api/FriendRequest/UpdateFriendRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\FriendRequest;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateFriendRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'receiver_id' => 'required',
|
||||
'status' => 'required'
|
||||
];
|
||||
}
|
||||
}
|
||||
37
app/Http/Requests/Api/Insurance/StoreInsuranceRequest.php
Normal file
37
app/Http/Requests/Api/Insurance/StoreInsuranceRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Insurance;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreInsuranceRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'hospital_id' => 'required',
|
||||
'full_name' => 'required',
|
||||
'address' => 'required',
|
||||
'email' => 'required|email',
|
||||
'medical_problem' => 'required',
|
||||
'aadhar_card_number' => 'required|max:12|min:12',
|
||||
'aadhar_card_front_photo' => 'required|image|mimes:jpeg,png,jpg,webp|max:2048',
|
||||
'aadhar_card_back_photo' => 'required|image|mimes:jpeg,png,jpg,webp|max:2048',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\PassiveUser;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePassiveUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'relationship' => 'required',
|
||||
'birth_date' => 'required|date_format:Y-m-d|lessThan:14',
|
||||
'avatar' => 'mimes:jpeg,png,jpg',
|
||||
// 'school_name' => 'required',
|
||||
// 'about' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation messages that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'birth_date.less_than' => "Age must me less than 14 years",
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\PassiveUser;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use App\Constant\Constant;
|
||||
|
||||
class UpdatePassiveUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'relationship' => 'required',
|
||||
'birth_date' => 'required|date_format:Y-m-d|lessThan:14',
|
||||
'avatar' => 'mimes:jpeg,png,jpg',
|
||||
// 'school_name' => 'required',
|
||||
// 'about' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation messages that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'birth_date.less_than' => "Age must me less than 14 years",
|
||||
];
|
||||
}
|
||||
}
|
||||
32
app/Http/Requests/Api/Post/GetSantPostRequest.php
Normal file
32
app/Http/Requests/Api/Post/GetSantPostRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GetSantPostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$array = [
|
||||
'sant_id' => 'nullable|exists:sants,id',
|
||||
];
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Api/Post/PostAddCommentRequest.php
Normal file
31
app/Http/Requests/Api/Post/PostAddCommentRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PostAddCommentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'post_id' => 'required|exists:posts,id',
|
||||
'reply_id' => 'nullable|exists:post_comments,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Api/Post/PostLikeRequest.php
Normal file
30
app/Http/Requests/Api/Post/PostLikeRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PostLikeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'post_id' => 'required|exists:posts,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Api/Post/PostRemoveCommentRequest.php
Normal file
30
app/Http/Requests/Api/Post/PostRemoveCommentRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PostRemoveCommentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'comment_id' => 'required|exists:post_comments,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Api/Post/PostUpdateCommentRequest.php
Normal file
30
app/Http/Requests/Api/Post/PostUpdateCommentRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class PostUpdateCommentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'post_id' => 'required|exists:posts,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
59
app/Http/Requests/Api/Post/StorePostRequest.php
Normal file
59
app/Http/Requests/Api/Post/StorePostRequest.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class StorePostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$array = [
|
||||
'privacy' => 'required',
|
||||
'images' => 'array|required_without:description',
|
||||
'images.*' => 'image|mimes:jpeg,png,jpg,gif|max:15360',
|
||||
'description' => 'required_without:images',
|
||||
'category_id' => 'required|exists:categories,id',
|
||||
'type' => 'nullable|in:1,2,3',
|
||||
'type_id' => 'nullable|exists:users,id',
|
||||
];
|
||||
|
||||
$name = Route::currentRouteName();
|
||||
|
||||
if ($name == 'api.post.sant.store') {
|
||||
$array['type_id'] = 'required|exists:sants,id';
|
||||
$array['type'] = 'required|in:2';
|
||||
}
|
||||
|
||||
if ($data['type'] == Constant::POST_TYPE_SANT) {
|
||||
$array['type_id'] = 'required|exists:sants,id';
|
||||
$array['type'] = 'required|in:2';
|
||||
}
|
||||
|
||||
if ($data['type'] == Constant::POST_TYPE_SANGH) {
|
||||
$array['type_id'] = 'required|exists:sanghs,id';
|
||||
$array['type'] = 'required|in:3';
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
42
app/Http/Requests/Api/Post/UpdatePostRequest.php
Normal file
42
app/Http/Requests/Api/Post/UpdatePostRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Post;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdatePostRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$array = [
|
||||
'privacy' => 'required',
|
||||
'images' => 'array|required_without:description',
|
||||
'images.*' => 'image|mimes:jpeg,png,jpg|max:15360',
|
||||
'description' => 'required_without:images',
|
||||
'category_id' => 'required|exists:categories,id',
|
||||
'removed_image_id' => 'array'
|
||||
];
|
||||
|
||||
if ($this->post->postImages()->exists()) {
|
||||
$array['description'] = 'nullable';
|
||||
$array['images'] = 'array';
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Api/Sangh/SanghFollowRequest.php
Normal file
30
app/Http/Requests/Api/Sangh/SanghFollowRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Sangh;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SanghFollowRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sangh_id' => 'required|exists:sanghs,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
58
app/Http/Requests/Api/Sangh/StoreSanghRequest.php
Normal file
58
app/Http/Requests/Api/Sangh/StoreSanghRequest.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Sangh;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSanghRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$request = [
|
||||
'sangh_type' => 'required',
|
||||
'name' => 'required',
|
||||
'state' => 'required',
|
||||
'city' => 'required',
|
||||
'address' => 'required',
|
||||
'email' => 'email',
|
||||
'mobile_number' => 'required',
|
||||
'number_of_members' => 'required',
|
||||
'bank_account_number' => 'integer',
|
||||
'avatar' => 'required'
|
||||
];
|
||||
|
||||
if($this->library_status === Constant::STATUS_ONE){
|
||||
$request['library_name'] = 'required';
|
||||
$request['librarian_name'] = 'required';
|
||||
$request['librarian_mobile_number'] = 'required';
|
||||
$request['number_of_books'] = 'required';
|
||||
}
|
||||
if ($this->sangh_type === Constant::STATUS_TWO) {
|
||||
$request['mulnayak_bhagwan_name'] = 'required';
|
||||
}
|
||||
|
||||
if ($this->bank_account_number != '') {
|
||||
$request['bank_ifsc'] = 'required';
|
||||
$request['bank_branch'] = 'required';
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
}
|
||||
42
app/Http/Requests/Api/Sangh/UpdateSanghRequest.php
Normal file
42
app/Http/Requests/Api/Sangh/UpdateSanghRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Sangh;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use App\Constant\Constant;
|
||||
|
||||
class UpdateSanghRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
// 'name' => 'required',
|
||||
// 'father_name' => 'required',
|
||||
// 'mother_name' => 'required',
|
||||
// 'gender' => 'required',
|
||||
// 'avatar' => 'mimes:jpeg,png,jpg',
|
||||
// 'honor' => 'required',
|
||||
// 'dharma_id' => 'required',
|
||||
// 'sampraday_id' => 'required',
|
||||
// 'birth_date' => 'required',
|
||||
// 'diksha_date' => 'required',
|
||||
// 'diksha_place' => 'required',
|
||||
// 'about' => 'required'
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Api/Sant/SantFollowRequest.php
Normal file
30
app/Http/Requests/Api/Sant/SantFollowRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Sant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SantFollowRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'required|exists:sants,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
43
app/Http/Requests/Api/Sant/StoreSantRequest.php
Normal file
43
app/Http/Requests/Api/Sant/StoreSantRequest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Sant;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSantRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
// 'father_name' => 'required',
|
||||
// 'mother_name' => 'required',
|
||||
'gender' => 'required',
|
||||
'avatar' => ['nullable','mimes:jpeg,png,jpg'],
|
||||
// 'honor' => 'required',
|
||||
'dharma_id' => 'required',
|
||||
'sampraday_id' => 'required',
|
||||
// 'birth_date' => 'required',
|
||||
// 'diksha_date' => 'required',
|
||||
// 'diksha_place' => 'required',
|
||||
'about' => 'nullable'
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
42
app/Http/Requests/Api/Sant/UpdateSantRequest.php
Normal file
42
app/Http/Requests/Api/Sant/UpdateSantRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Sant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use App\Constant\Constant;
|
||||
|
||||
class UpdateSantRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
// 'father_name' => 'required',
|
||||
// 'mother_name' => 'required',
|
||||
'gender' => 'required',
|
||||
'avatar' => ['nullable','mimes:jpeg,png,jpg'],
|
||||
// 'honor' => 'required',
|
||||
'dharma_id' => 'required',
|
||||
'sampraday_id' => 'required',
|
||||
// 'birth_date' => 'required',
|
||||
// 'diksha_date' => 'required',
|
||||
// 'diksha_place' => 'required',
|
||||
'about' => 'nullable'
|
||||
];
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Api/Thana/StoreThanaRequest.php
Normal file
44
app/Http/Requests/Api/Thana/StoreThanaRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Thana;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class StoreThanaRequest extends FormRequest
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'required|exists:sants,id'
|
||||
];
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
if (Request::wantsJson()) {
|
||||
throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422));
|
||||
} else {
|
||||
throw new ValidationException($validator);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
app/Http/Requests/Api/Thana/UpdateThanaRequest.php
Normal file
44
app/Http/Requests/Api/Thana/UpdateThanaRequest.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Thana;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdateThanaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'required|exists:sants,id'
|
||||
];
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
if (Request::wantsJson()) {
|
||||
throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422));
|
||||
} else {
|
||||
throw new ValidationException($validator);
|
||||
}
|
||||
}
|
||||
}
|
||||
77
app/Http/Requests/Api/Vihar/DeleteViharRequest.php
Normal file
77
app/Http/Requests/Api/Vihar/DeleteViharRequest.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Vihar;
|
||||
|
||||
use App\Rules\DeleteVihar;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
class DeleteViharRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function getValidatorInstance()
|
||||
{
|
||||
$this->request->set('delete', 1);
|
||||
|
||||
return parent::getValidatorInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$array = [
|
||||
'delete' => 'sometimes',
|
||||
];
|
||||
|
||||
$startDate = Carbon::createFromFormat('Y-m-d H:i:s', $this->vihar->start_date .' '. '00:00:00');
|
||||
$todayDate = Carbon::createFromFormat('Y-m-d H:i:s', Carbon::now()->format('Y-m-d') .' '. '00:00:00');
|
||||
$result = $todayDate->eq($startDate);
|
||||
|
||||
if ($result) {
|
||||
$array['delete'] = [new DeleteVihar($this->vihar)];
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
if (Request::wantsJson()) {
|
||||
throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422));
|
||||
} else {
|
||||
throw new ValidationException($validator);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'start_time.after' => 'Please enter a time after the current time.',
|
||||
];
|
||||
}
|
||||
}
|
||||
33
app/Http/Requests/Api/Vihar/GetViharRequest.php
Normal file
33
app/Http/Requests/Api/Vihar/GetViharRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Vihar;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GetViharRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'page' => 'integer',
|
||||
'limit' => 'integer',
|
||||
'sant_id' => 'required|exists:sants,id',
|
||||
];
|
||||
}
|
||||
}
|
||||
98
app/Http/Requests/Api/Vihar/StoreViharRequest.php
Normal file
98
app/Http/Requests/Api/Vihar/StoreViharRequest.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Vihar;
|
||||
|
||||
use App\Rules\ViharCanNotAfterTwoHours;
|
||||
use Carbon\Carbon;
|
||||
use App\Rules\ViharDoesNotStoreForSameDateTime;
|
||||
use App\Rules\ViharStorePerDay;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class StoreViharRequest extends FormRequest
|
||||
{
|
||||
|
||||
/**
|
||||
* Indicates if the validator should stop on the first rule failure.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $stopOnFirstFailure = true;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function getValidatorInstance()
|
||||
{
|
||||
$this->request->set('per_day', 2);
|
||||
$this->request->set('date_time', 1);
|
||||
$this->request->set('next_vihar', 1);
|
||||
|
||||
return parent::getValidatorInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(Request $request)
|
||||
{
|
||||
$array = [
|
||||
'sant_id' => 'exists:sants,id',
|
||||
'from' => 'required',
|
||||
'to' => 'required',
|
||||
'start_date' => 'required|date_format:Y-m-d',
|
||||
'start_time' => 'date_format:H:i',
|
||||
// 'end_date' => 'required|date_format:Y-m-d|after_or_equal:start_date',
|
||||
'per_day' => [new ViharStorePerDay($request->all())],
|
||||
'date_time' => [new ViharDoesNotStoreForSameDateTime($request->all())],
|
||||
'next_vihar' => [new ViharCanNotAfterTwoHours($request->all())],
|
||||
];
|
||||
|
||||
$startDate = Carbon::createFromFormat('Y-m-d H:i:s', $request->start_date .' '. '00:00:00');
|
||||
$todayDate = Carbon::createFromFormat('Y-m-d H:i:s', Carbon::now()->format('Y-m-d') .' '. '00:00:00');
|
||||
$result = $todayDate->eq($startDate);
|
||||
|
||||
if ($result) {
|
||||
$array['start_time'] = 'date_format:H:i|after:'.Carbon::now()->format('H:i');
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
if (Request::wantsJson()) {
|
||||
throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422));
|
||||
} else {
|
||||
throw new ValidationException($validator);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'start_time.after' => 'Please enter a time after the current time.',
|
||||
];
|
||||
}
|
||||
}
|
||||
92
app/Http/Requests/Api/Vihar/UpdateViharRequest.php
Normal file
92
app/Http/Requests/Api/Vihar/UpdateViharRequest.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api\Vihar;
|
||||
|
||||
use App\Rules\ViharCanNotAfterTwoHours;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Rules\ViharDoesNotStoreForSameDateTime;
|
||||
use App\Rules\ViharStorePerDay;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpdateViharRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function getValidatorInstance()
|
||||
{
|
||||
$this->request->set('per_day', 2);
|
||||
$this->request->set('date_time', 1);
|
||||
$this->request->set('next_vihar', 1);
|
||||
|
||||
return parent::getValidatorInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(Request $request)
|
||||
{
|
||||
$array = [
|
||||
'sant_id' => 'exists:sants,id',
|
||||
'from' => 'required',
|
||||
'to' => 'required',
|
||||
'start_date' => 'required|date_format:Y-m-d',
|
||||
'start_time' => 'required|date_format:H:i',
|
||||
// 'end_date' => 'required|date_format:Y-m-d|after_or_equal:start_date',
|
||||
// 'end_time' => 'date_format:H:i|after:start_time',
|
||||
// 'end_date' => 'required|date_format:Y-m-d|after_or_equal:start_date',
|
||||
'date_time' => [new ViharDoesNotStoreForSameDateTime($request->all(), $this->vihar->id)],
|
||||
'per_day' => [new ViharStorePerDay($request->all(), $this->vihar->id)],
|
||||
'next_vihar' => [new ViharCanNotAfterTwoHours($request->all(), $this->vihar->id)],
|
||||
];
|
||||
|
||||
$startDate = Carbon::createFromFormat('Y-m-d H:i:s', $request->start_date .' '. '00:00:00');
|
||||
$todayDate = Carbon::createFromFormat('Y-m-d H:i:s', Carbon::now()->format('Y-m-d') .' '. '00:00:00');
|
||||
$result = $todayDate->eq($startDate);
|
||||
|
||||
if ($result) {
|
||||
$array['start_time'] = 'date_format:H:i|after:'.Carbon::now()->format('H:i');
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
if (Request::wantsJson()) {
|
||||
throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422));
|
||||
} else {
|
||||
throw new ValidationException($validator);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'start_time.after' => 'Please enter a time after the current time.',
|
||||
];
|
||||
}
|
||||
}
|
||||
55
app/Http/Requests/ChangePassword/ChangePasswordRequest.php
Normal file
55
app/Http/Requests/ChangePassword/ChangePasswordRequest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\ChangePassword;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class ChangePasswordRequest
|
||||
* @package App\Modules\Frontend\Auth\Http\Requests\ChangePassword
|
||||
*/
|
||||
class ChangePasswordRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Indicates if the validator should stop on the first rule failure.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $stopOnFirstFailure = true;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'current_password' => 'required',
|
||||
'new_password' => 'required|min:8|same:confirm_password',
|
||||
'confirm_password' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation massages that apply to the rules.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
69
app/Http/Requests/ChangePassword/SetPasswordRequest.php
Normal file
69
app/Http/Requests/ChangePassword/SetPasswordRequest.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\ChangePassword;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* Class SetPasswordRequest
|
||||
* @package App\Modules\Frontend\Auth\Http\Requests\ChangePassword
|
||||
*/
|
||||
class SetPasswordRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Indicates if the validator should stop on the first rule failure.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $stopOnFirstFailure = true;
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'country_code' => 'required',
|
||||
'mobile' => 'required',
|
||||
'new_password' => 'required|min:8|same:confirm_password',
|
||||
'confirm_password' => 'required',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation massages that apply to the rules.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
protected function failedValidation(Validator $validator)
|
||||
{
|
||||
if (Request::wantsJson()) {
|
||||
throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422));
|
||||
} else {
|
||||
throw new ValidationException($validator);
|
||||
}
|
||||
}
|
||||
}
|
||||
39
app/Http/Requests/Chaturmas/StoreChaturmasRequest.php
Normal file
39
app/Http/Requests/Chaturmas/StoreChaturmasRequest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Chaturmas;
|
||||
|
||||
use App\Models\Sant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class StoreChaturmasRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(Request $request)
|
||||
{
|
||||
return [
|
||||
'place' => 'required',
|
||||
'chaturmas_date_id' => [
|
||||
'required' , 'exists:chaturmas_dates,id',
|
||||
'date_format:Y',
|
||||
Rule::unique('chaturmas', 'chaturmas_date_id')
|
||||
->where('sant_id', $request->route('sant')->id),
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
40
app/Http/Requests/Chaturmas/UpdateChaturmasRequest.php
Normal file
40
app/Http/Requests/Chaturmas/UpdateChaturmasRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Chaturmas;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateChaturmasRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(Request $request)
|
||||
{
|
||||
return [
|
||||
'place' => 'required',
|
||||
'chaturmas_date_id' => [
|
||||
'required',
|
||||
'exists:chaturmas_dates,id',
|
||||
'date_format:Y',
|
||||
Rule::unique('chaturmas', 'chaturmas_date_id')
|
||||
->where('sant_id', $this->chaturma->sant_id)
|
||||
->ignore($this->chaturma->id),
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\ChaturmasDate;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreChaturmasDateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'year' => 'required|date_format:Y|unique:chaturmas_dates,year',
|
||||
'from' => 'required|date_format:Y-m-d',
|
||||
'to' => 'required|date_format:Y-m-d|after_or_equal:from',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\ChaturmasDate;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateChaturmasDateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'year' => 'required|date_format:Y|unique:chaturmas_dates,year,'.$this->chaturmas_date->id,
|
||||
'from' => 'required|date_format:Y-m-d',
|
||||
'to' => 'required|date_format:Y-m-d|after_or_equal:from',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Dharma/StoreDharmaRequest.php
Normal file
30
app/Http/Requests/Dharma/StoreDharmaRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Dharma;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreDharmaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:dharma,name',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Dharma/UpdateDharmaRequest.php
Normal file
30
app/Http/Requests/Dharma/UpdateDharmaRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Dharma;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateDharmaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:dharma,name,'.$this->dharma->id,
|
||||
];
|
||||
}
|
||||
}
|
||||
37
app/Http/Requests/Hospital/HospitalStoreRequest.php
Normal file
37
app/Http/Requests/Hospital/HospitalStoreRequest.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Hospital;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class HospitalStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'contact_name' => 'required',
|
||||
'email' => 'required',
|
||||
'number' => 'required',
|
||||
'photo' => 'required',
|
||||
'city' => 'required',
|
||||
'state' => 'required',
|
||||
'address' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Jati/StoreJatiRequest.php
Normal file
30
app/Http/Requests/Jati/StoreJatiRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Jati;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreJatiRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:jatis,name',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Jati/UpdateJatiRequest.php
Normal file
30
app/Http/Requests/Jati/UpdateJatiRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Jati;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateJatiRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:jatis,name,'.$this->jati->id,
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Role/StoreRoleRequest.php
Normal file
30
app/Http/Requests/Role/StoreRoleRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Role;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreRoleRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:roles,name',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Role/UpdateRoleRequest.php
Normal file
30
app/Http/Requests/Role/UpdateRoleRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Role;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateRoleRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:roles,name,'.$this->role->id,
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Sampraday/StoreSampradayRequest.php
Normal file
31
app/Http/Requests/Sampraday/StoreSampradayRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sampraday;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSampradayRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:sampradays,name',
|
||||
'dharma_id' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Sampraday/UpdateSampradayRequest.php
Normal file
31
app/Http/Requests/Sampraday/UpdateSampradayRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sampraday;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateSampradayRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:sampradays,name,'.$this->sampraday->id,
|
||||
'dharma_id' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
37
app/Http/Requests/Sangh/CreateSanghMemberCard.php
Normal file
37
app/Http/Requests/Sangh/CreateSanghMemberCard.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sangh;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateSanghMemberCard extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'profile_image' => 'max:2048'
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'profile_image.max' => 'The profile image must not exceed 2 MB.'
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/Sangh/StoreSanghRequest.php
Normal file
30
app/Http/Requests/Sangh/StoreSanghRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sangh;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSanghRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/Sangh/UpdateSanghRequest.php
Normal file
29
app/Http/Requests/Sangh/UpdateSanghRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sangh;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateSanghRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Sant/StoreSantRequest.php
Normal file
31
app/Http/Requests/Sant/StoreSantRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sant;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreSantRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Sant/UpdateSantRequest.php
Normal file
31
app/Http/Requests/Sant/UpdateSantRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Sant;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateSantRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Constant::STATUS_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/StoreCategoryRequest.php
Normal file
30
app/Http/Requests/StoreCategoryRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreCategoryRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/StoreDesignationRequest.php
Normal file
30
app/Http/Requests/StoreDesignationRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreDesignationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/StorePostImageRequest.php
Normal file
30
app/Http/Requests/StorePostImageRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StorePostImageRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/StoreThanaMemberRequest.php
Normal file
30
app/Http/Requests/StoreThanaMemberRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreThanaMemberRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/StoreThanaRequest.php
Normal file
30
app/Http/Requests/StoreThanaRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreThanaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/UpdateCategoryRequest.php
Normal file
30
app/Http/Requests/UpdateCategoryRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateCategoryRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/UpdateDesignationRequest.php
Normal file
30
app/Http/Requests/UpdateDesignationRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateDesignationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/UpdatePostImageRequest.php
Normal file
30
app/Http/Requests/UpdatePostImageRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdatePostImageRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/UpdateThanaMemberRequest.php
Normal file
30
app/Http/Requests/UpdateThanaMemberRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateThanaMemberRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
30
app/Http/Requests/UpdateThanaRequest.php
Normal file
30
app/Http/Requests/UpdateThanaRequest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateThanaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
46
app/Http/Requests/User/AdminStoreRequest.php
Normal file
46
app/Http/Requests/User/AdminStoreRequest.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use App\Rules\CheckUniqueEmailHashValue;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AdminStoreRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users', new CheckUniqueEmailHashValue],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'name.required' => __('validation.required'),
|
||||
'email.required' => __('validation.required'),
|
||||
'email.unique' => __('validation.unique'),
|
||||
];
|
||||
}
|
||||
}
|
||||
45
app/Http/Requests/User/AdminUpdateRequest.php
Normal file
45
app/Http/Requests/User/AdminUpdateRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use App\Rules\CheckUniqueEmailHashValue;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AdminUpdateRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|unique:users,email,'.$this->user->id,
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users', new CheckUniqueEmailHashValue($this->user->id)],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'name.required' => __('validation.required'),
|
||||
'email.required' => __('validation.required'),
|
||||
'email.unique' => __('validation.unique'),
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/User/StoreUserRequest.php
Normal file
41
app/Http/Requests/User/StoreUserRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|unique:users,name',
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'mobile' => 'required|unique:users,mobile',
|
||||
'avatar' => 'required|mimes:jpeg,png,jpg',
|
||||
'gender' => 'required',
|
||||
'dharma_id' => 'required',
|
||||
'jati_id' => 'required',
|
||||
'profession' => 'required',
|
||||
// 'speciality_of_profession' => 'required',
|
||||
/*'native_place' => 'required',
|
||||
'current_location' => 'required',
|
||||
'status' => 'required'*/
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/User/UpdateUserRequest.php
Normal file
41
app/Http/Requests/User/UpdateUserRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\User;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateUserRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'email' => 'required|email|unique:users,email,'.$this->user->id,
|
||||
'mobile' => 'required|unique:users,mobile,'.$this->user->id,
|
||||
'avatar' => 'required||mimes:jpeg,png,jpg',
|
||||
'gender' => 'required',
|
||||
'dharma_id' => 'required',
|
||||
'jati_id' => 'required',
|
||||
'profession' => 'required',
|
||||
// 'speciality_of_profession' => 'required',
|
||||
/*'native_place' => 'required',
|
||||
'current_location' => 'required',
|
||||
'status' => 'required'*/
|
||||
];
|
||||
}
|
||||
}
|
||||
34
app/Http/Requests/Vihar/StoreViharRequest.php
Normal file
34
app/Http/Requests/Vihar/StoreViharRequest.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Vihar;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreViharRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'exists:sants,id',
|
||||
'from' => 'required',
|
||||
'to' => 'required',
|
||||
'start_date' => 'required|date_format:Y-m-d',
|
||||
'start_time' => 'required|date_format:H:i'
|
||||
];
|
||||
}
|
||||
}
|
||||
32
app/Http/Requests/Vihar/UpdateViharRequest.php
Normal file
32
app/Http/Requests/Vihar/UpdateViharRequest.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Vihar;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateViharRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'sant_id' => 'exists:sants,id',
|
||||
'start_date' => 'required|date_format:Y-m-d',
|
||||
'start_time' => 'required|date_format:H:i',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user