Fixes https://lab.s-web.fr/ldc-web/projets/com-app/-/issues/47 StoreDocument set uuid on mode create
This commit is contained in:
parent
708405c7a2
commit
3a9d671373
3 changed files with 3 additions and 2 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue