storage updates

This commit is contained in:
Vijay Sebastian
2017-05-12 11:45:21 +05:30
parent f06f07c10e
commit 03cdb3976b
3 changed files with 90 additions and 88 deletions

View File

@@ -229,16 +229,18 @@ class FormController extends Controller
$ticketId = Tickets::where('ticket_number', '=', $result[0])->first();
$thread = Ticket_Thread::where('ticket_id', '=', $ticketId->id)->first();
if ($attachments != null) {
foreach ($attachments as $attachment) {
if ($attachment != null) {
$name = $attachment->getClientOriginalName();
$type = $attachment->getClientOriginalExtension();
$size = $attachment->getSize();
$data = file_get_contents($attachment->getRealPath());
$attachPath = $attachment->getRealPath();
$ta->create(['thread_id' => $thread->id, 'name' => $name, 'size' => $size, 'type' => $type, 'file' => $data, 'poster' => 'ATTACHMENT']);
}
}
$storage = new \App\FaveoStorage\Controllers\StorageController();
$storage->saveAttachments($thread->id, $attachments);
// foreach ($attachments as $attachment) {
// if ($attachment != null) {
// $name = $attachment->getClientOriginalName();
// $type = $attachment->getClientOriginalExtension();
// $size = $attachment->getSize();
// $data = file_get_contents($attachment->getRealPath());
// $attachPath = $attachment->getRealPath();
// $ta->create(['thread_id' => $thread->id, 'name' => $name, 'size' => $size, 'type' => $type, 'file' => $data, 'poster' => 'ATTACHMENT']);
// }
// }
}
// dd($result);
return Redirect::back()->with('success', Lang::get('lang.Ticket-has-been-created-successfully-your-ticket-number-is').' '.$result[0].'. '.Lang::get('lang.Please-save-this-for-future-reference'));