This commit is contained in:
Jérémy Munsch 2023-09-05 12:33:20 +02:00
parent 708405c7a2
commit 3a9d671373
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 3 additions and 2 deletions

View file

@ -40,7 +40,6 @@ class StoreDocumentRequest extends FormRequest
return [
'directory_id' => 'sometimes|nullable|integer',
'document_id' => 'sometimes|nullable|integer',
'uuid' => 'required|min:3|max:255',
'title' => 'required|min:3|max:255',
'type' => 'required|min:3|max:255',
'path' => 'required|min:3|max:255',

View file

@ -7,6 +7,7 @@ use App\Lib\Helpers\ToolboxHelper;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
/**
* @property integer $id
@ -68,6 +69,7 @@ class Document extends Model
protected static function booted()
{
static::creating(function (self $model) {
$model->uuid = Str::uuid();
self::assertFieldIsUnique('title', $model->title);
self::setOrder($model);
});

View file

@ -18,7 +18,7 @@ class AppServiceProvider extends ServiceProvider
public function boot()
{
// * HTTPS FIX
URL::forceScheme('https');
//URL::forceScheme('http');
// * HA PROXY FIX
App::singleton('clientIp', function () {
if (config('app.env') === 'local') {