refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
14
app/Http/Requests/AuthorizedRequest.php
Normal file
14
app/Http/Requests/AuthorizedRequest.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
class AuthorizedRequest extends Request
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
18
app/Http/Requests/EmailChangeRequest.php
Normal file
18
app/Http/Requests/EmailChangeRequest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
class EmailChangeRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'newmail' => 'required|email|max:255|unique:users,email',
|
||||
];
|
||||
}
|
||||
}
|
||||
18
app/Http/Requests/ImportsRequest.php
Normal file
18
app/Http/Requests/ImportsRequest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
class ImportsRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'vcard' => 'required|file|max:'.config('monica.max_upload_size').'|mimes:vcf,vcard',
|
||||
];
|
||||
}
|
||||
}
|
||||
18
app/Http/Requests/InvitationRequest.php
Normal file
18
app/Http/Requests/InvitationRequest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
class InvitationRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'email' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
20
app/Http/Requests/Journal/DaysRequest.php
Normal file
20
app/Http/Requests/Journal/DaysRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Journal;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class DaysRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'rate' => 'integer|required',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/PasswordChangeRequest.php
Normal file
21
app/Http/Requests/PasswordChangeRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Validation\Rules\Password as PasswordRules;
|
||||
|
||||
class PasswordChangeRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'password_current' => 'required',
|
||||
'password' => ['required', 'confirmed', PasswordRules::defaults()],
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/People/ContactFieldsRequest.php
Normal file
21
app/Http/Requests/People/ContactFieldsRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class ContactFieldsRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'contact_field_type_id' => 'required|integer',
|
||||
'data' => 'max:255|required',
|
||||
];
|
||||
}
|
||||
}
|
||||
20
app/Http/Requests/People/ConversationRequest.php
Normal file
20
app/Http/Requests/People/ConversationRequest.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class ConversationRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'happened_at' => 'required|date',
|
||||
];
|
||||
}
|
||||
}
|
||||
23
app/Http/Requests/People/DebtRequest.php
Normal file
23
app/Http/Requests/People/DebtRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class DebtRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'in_debt' => 'required',
|
||||
'amount' => 'required|numeric',
|
||||
'reason' => 'string|nullable',
|
||||
'status' => '',
|
||||
];
|
||||
}
|
||||
}
|
||||
27
app/Http/Requests/People/GiftsRequest.php
Normal file
27
app/Http/Requests/People/GiftsRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class GiftsRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'comment' => '',
|
||||
'url' => '',
|
||||
'offered' => 'string',
|
||||
'date_offered' => 'date|nullable',
|
||||
'value' => 'integer|nullable',
|
||||
'has_recipient' => 'boolean',
|
||||
'recipient' => 'required_with:has_recipient',
|
||||
];
|
||||
}
|
||||
}
|
||||
18
app/Http/Requests/People/NoteToggleRequest.php
Normal file
18
app/Http/Requests/People/NoteToggleRequest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class NoteToggleRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/People/NotesRequest.php
Normal file
21
app/Http/Requests/People/NotesRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class NotesRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'body' => 'required|string',
|
||||
'is_favorited' => 'boolean|required',
|
||||
];
|
||||
}
|
||||
}
|
||||
21
app/Http/Requests/People/PetsRequest.php
Normal file
21
app/Http/Requests/People/PetsRequest.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\People;
|
||||
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class PetsRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'max:255|nullable',
|
||||
'pet_category_id' => 'integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
10
app/Http/Requests/Request.php
Normal file
10
app/Http/Requests/Request.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
abstract class Request extends FormRequest
|
||||
{
|
||||
//
|
||||
}
|
||||
24
app/Http/Requests/Settings/GendersRequest.php
Normal file
24
app/Http/Requests/Settings/GendersRequest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Settings;
|
||||
|
||||
use App\Models\Contact\Gender;
|
||||
use Illuminate\Validation\Rule;
|
||||
use App\Http\Requests\AuthorizedRequest;
|
||||
|
||||
class GendersRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'type' => ['required', Rule::in(Gender::LIST)],
|
||||
'name' => 'max:255',
|
||||
'id' => 'integer',
|
||||
];
|
||||
}
|
||||
}
|
||||
41
app/Http/Requests/SettingsRequest.php
Normal file
41
app/Http/Requests/SettingsRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\User\User;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class SettingsRequest extends AuthorizedRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'first_name' => 'required|max:255',
|
||||
'last_name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users,email,'.$this->id,
|
||||
'timezone' => 'required|string',
|
||||
'fluid_container' => 'required|bool',
|
||||
'temperature_scale' => [
|
||||
'required',
|
||||
'string',
|
||||
Rule::in(['fahrenheit', 'celsius']),
|
||||
],
|
||||
'locale' => [
|
||||
'required',
|
||||
'string',
|
||||
Rule::In(config('lang-detector.languages')),
|
||||
],
|
||||
'currency_id' => 'required|int|exists:currencies,id',
|
||||
'name_order' => [
|
||||
'required',
|
||||
'string',
|
||||
Rule::In(User::NAMES_ORDER),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user