File manager - Edit - /var/www/html/portal/app/Http/Services/Accounts/Chamados/ChamadoArquivoService.php
Back
<?php namespace App\Http\Services\Accounts\Chamados; use App\Http\Controllers\Controller; use App\Models\Accounts\Chamados\Chamado; use App\Models\Arquivo; use Illuminate\Support\Facades\DB; use Illuminate\Http\RedirectResponse; class ChamadoArquivoService extends Controller { protected $Arquivo = Arquivo::class; protected $Chamado = Chamado::class; public function save(Array $array_arquivo): RedirectResponse|bool { try { DB::beginTransaction(); $this->Arquivo::create($array_arquivo); DB::commit(); return true; } catch (\Exception $e) { DB::rollBack(); return redirect() ->back() ->withInput() ->with('error', 'Erro ao tentar criar imagem. ' . $e->getMessage()); } } public function updateChamado(Chamado $chamado, Array $array_chamado): ?RedirectResponse { try { DB::beginTransaction(); $chamado->fill($array_chamado); $chamado->save(); DB::commit(); return null; } catch (\Exception $e) { DB::rollBack(); return redirect() ->back() ->withInput() ->with('error', 'Erro tentar atualizar esse chamado. ' . $e->getMessage()); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings