Commit 3c96e939 authored by Nicolas Widart's avatar Nicolas Widart

Returning the created model

parent 63934248
...@@ -26,14 +26,12 @@ class EloquentFileRepository extends EloquentBaseRepository implements FileRepos ...@@ -26,14 +26,12 @@ class EloquentFileRepository extends EloquentBaseRepository implements FileRepos
{ {
$fileName = FileHelper::slug($file->getClientOriginalName()); $fileName = FileHelper::slug($file->getClientOriginalName());
$this->model->create([ return $this->model->create([
'filename' => $fileName, 'filename' => $fileName,
'path' => public_path() . "/assets/media/{$fileName}", 'path' => public_path() . "/assets/media/{$fileName}",
'extension' => $file->guessClientExtension(), 'extension' => $file->guessClientExtension(),
'mimetype' => $file->getClientMimeType(), 'mimetype' => $file->getClientMimeType(),
'filesize' => $file->getFileInfo()->getSize(), 'filesize' => $file->getFileInfo()->getSize(),
]); ]);
return $this->model;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment