backend refactoring

This commit is contained in:
carodej
2020-04-27 08:34:09 +02:00
parent 586f0bba68
commit 65147870fd
22 changed files with 322 additions and 169 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Http\Requests\Share;
use Illuminate\Foundation\Http\FormRequest;
class AuthenticateShareRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'password' => 'required|string',
];
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Http\Requests\Share;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class CreateShareRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'isPassword' => 'required|boolean',
'unique_id' => 'required|integer',
'type' => 'required|string',
'permission' => 'string',
'password' => 'string',
];
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests\Share;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
class UpdateShareRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'protected' => 'required|boolean',
'permission' => 'required|string',
'password' => 'string',
];
}
}