first commit

This commit is contained in:
2024-04-16 15:43:24 +05:45
commit b49e06fa93
4387 changed files with 543889 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace App\Http\Requests\Admission;
use Illuminate\Foundation\Http\FormRequest;
class AdmissionRequest 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()
{
$rules = [
'student_id'=>'required',
'country_id' => 'required|',
'state_id' => 'required|',
'college_id' => 'required|',
'fees' => 'required|',
'intake_year' => 'required|',
'intake_month' => 'required|',
];
return $rules;
}
public function data()
{
$data = [
'student_id' => $this->get('student_id'),
'college_id' => $this->get('college_id'),
'fees' => $this->get('fees'),
'country_id' => $this->get('country_id'),
'state_id' => $this->get('state_id'),
'intake_year' => $this->get('intake_year'),
'intake_month' => $this->get('intake_month'),
];
return $data;
}
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Http\Requests\Agent;
use Illuminate\Foundation\Http\FormRequest;
class AgentRequest 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',
];
}
public function data()
{
$data = [
'name' => $this->get('name'),
'email' => $this->get('email'),
'phone' => $this->get('phone'),
];
return $data;
}
}

View File

@@ -0,0 +1,85 @@
<?php
namespace App\Http\Requests\Auth;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
class LoginRequest 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\Rule|array|string>
*/
public function rules(): array
{
return [
'email' => ['required', 'string', 'email'],
'password' => ['required', 'string'],
];
}
/**
* Attempt to authenticate the request's credentials.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function authenticate(): void
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
/**
* Ensure the login request is not rate limited.
*
* @throws \Illuminate\Validation\ValidationException
*/
public function ensureIsNotRateLimited(): void
{
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
return;
}
event(new Lockout($this));
$seconds = RateLimiter::availableIn($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.throttle', [
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]),
]);
}
/**
* Get the rate limiting throttle key for the request.
*/
public function throttleKey(): string
{
return Str::transliterate(Str::lower($this->input('email')).'|'.$this->ip());
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace App\Http\Requests\Campaign;
use Illuminate\Foundation\Http\FormRequest;
class CampaignRequest 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()
{
$rules = [
'name'=>'required'
];
return $rules;
}
public function data(){
$inputs=[
'name' => $this->get('name'),
'alias' => $this->get('alias'),
'details' => $this->get('details'),
'starts' => $this->get('starts'),
'ends' => $this->get('ends'),
'success_message' => $this->get('success_message'),
'email_success' => $this->get('email_success'),
'sms_message' => $this->get('sms_message'),
'coupon_codes' => $this->get('coupon_codes'),
'url' => $this->get('url'),
'keywords' => $this->get('keywords'),
'ogtags' => $this->get('ogtags'),
'headers' => $this->get('headers'),
'description' => $this->get('description'),
'status' => ($this->get('status') ? $this->get('status') : '') == 'on' ? 'active' : 'in_active',
'created_by' => Auth()->user()->id,
];
if($this->get('offered_course')) {
$offered_course = collect($this->get('offered_course'));
}
if(isset($offered_course)) {
$inputs['offered_course'] = $offered_course->implode(',');
}
if($this->get('keywords')) {
$keywords = collect($this->get('keywords'));
}
if(isset($keywords)) {
$inputs['keywords'] = $keywords->implode(',');
}
if ($this->has('status')) {
$inputs['status'] = "active";
}
return $inputs;
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Http\Requests\DocumentCheckList;
use Illuminate\Foundation\Http\FormRequest;
class DocumentCheckListRequest 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 [
'applicant' => 'required',
];
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\Permission;
use Illuminate\Foundation\Http\FormRequest;
class PermissionRequest 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()
{
$rules = [
'name'=>'required'
];
return $rules;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Http\Requests;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ProfileUpdateRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'name' => ['string', 'max:255'],
'email' => ['email', 'max:255', Rule::unique(User::class)->ignore($this->user()->id)],
];
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\Role;
use Illuminate\Foundation\Http\FormRequest;
class RoleRequest 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()
{
$rules = [
'name'=>'required'
];
return $rules;
}
}

View File

@@ -0,0 +1,45 @@
<?php
namespace App\Http\Requests\Student;
use Illuminate\Foundation\Http\FormRequest;
class StudentRequest 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 [
'applicant' => 'required',
];
}
public function data()
{
$data = [
'applicant' => $this->get('applicant'),
'email' => $this->get('email'),
'phone' => $this->get('phone'),
'program' => $this->get('program'),
'intake_year' => $this->get('intake_year'),
'intake_month' => $this->get('intake_month'),
];
return $data;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Http\Requests\User;
use Illuminate\Foundation\Http\FormRequest;
class UserRequest 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()
{
$rules = [
'name'=>'required',
'email' => 'required|email|unique:users,email',
'password' => 'required|',
];
return $rules;
}
}