Upload Files Booking, Mails, Attachments,
This commit is contained in:
parent
5daea268f7
commit
68b9d1ff88
92 changed files with 2837 additions and 1778 deletions
52
app/Repositories/BookingFileRepository.php
Normal file
52
app/Repositories/BookingFileRepository.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\BookingFile;
|
||||
use Response;
|
||||
|
||||
class BookingFileRepository extends FileRepository {
|
||||
|
||||
|
||||
|
||||
protected $booking_file;
|
||||
protected $booking_id;
|
||||
protected $identifier;
|
||||
|
||||
|
||||
public function __construct(BookingFile $model){
|
||||
parent::__construct();
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function save(){
|
||||
$this->booking_file = BookingFile::create([
|
||||
'booking_id' => $this->booking_id,
|
||||
'identifier' => $this->identifier,
|
||||
'filename' => $this->allowed_filename,
|
||||
'dir' => $this->dir,
|
||||
'original_name' => $this->originalName,
|
||||
'ext' => $this->extension,
|
||||
'mine' => $this->mine,
|
||||
'size' => $this->size
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function response(){
|
||||
return Response::json([
|
||||
'error' => false,
|
||||
'filename' => $this->allowed_filename,
|
||||
'file_id' =>$this->booking_file->id,
|
||||
'file_data' => $this->extension,
|
||||
'file_icon' => $this->booking_file->getIconExt(),
|
||||
'file_format_bytes' => $this->booking_file->formatBytes(),
|
||||
'file_url' => $this->booking_file->getURL(),
|
||||
'redirect' => '',
|
||||
'code' => 200
|
||||
], 200);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue