Fewo Mails / Booking Country Services
This commit is contained in:
parent
b9c26d06d0
commit
48a6eb2282
154 changed files with 7761 additions and 1643 deletions
51
app/Repositories/GeneralFileRepository.php
Normal file
51
app/Repositories/GeneralFileRepository.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\GeneralFile;
|
||||
use Response;
|
||||
|
||||
class GeneralFileRepository extends FileRepository {
|
||||
|
||||
|
||||
|
||||
protected $general_file;
|
||||
protected $travel_country_id;
|
||||
protected $identifier;
|
||||
|
||||
|
||||
public function __construct(GeneralFile $model){
|
||||
parent::__construct();
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
|
||||
public function save(){
|
||||
$this->general_file = GeneralFile::create([
|
||||
'travel_country_id' => $this->travel_country_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->general_file->id,
|
||||
'file_data' => $this->extension,
|
||||
'file_icon' => $this->general_file->getIconExt(),
|
||||
'file_format_bytes' => $this->general_file->formatBytes(),
|
||||
'file_url' => $this->general_file->getURL(),
|
||||
'redirect' => $this->redirect,
|
||||
'code' => 200
|
||||
], 200);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue