Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
run: |
sudo docker exec app php oslab/artisan migrate

- name: Limpando cache de configuração
run: |
sudo docker exec app php oslab/artisan optimize:clear

- name: Rodar Artisan db:update-defaults (chamando direto na classe)
run: |
sudo docker exec app php oslab/artisan db:seed --class DatabaseDefaultPermissionsUpdate
14 changes: 6 additions & 8 deletions app/Http/Controllers/Configuracao/User/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
use Intervention\Image\Facades\Image;
use Intervention\Image\Laravel\Facades\Image;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;

Expand Down Expand Up @@ -82,12 +82,12 @@ public function store(Request $request)
$user->estado = $request->estado;
$user->complemento = $request->complemento;
$user->expire_at = $request->expire_at;
$user->syncRoles(array_map(fn ($val) => (int) $val, $request->role));
if ($request->role) {
$user->syncRoles(array_map(fn ($val) => (int) $val, $request->role));
}

if ($request->img_perfil) {
$resizedImage = Image::make($request->img_perfil)->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
});
$resizedImage = Image::read($request->img_perfil)->scale(500, null);
// Gerar um nome único para a imagem
$imageName = Str::uuid().'.'.$request->img_perfil->getClientOriginalExtension();
// Salvar a imagem no diretório destinado a imagens de perfil
Expand Down Expand Up @@ -163,9 +163,7 @@ public function update(Request $request, User $user)
if (file_exists(storage_path('app/public/img_perfil/').$tempImage) && $tempImage != null) {
unlink(storage_path('app/public/img_perfil/').$tempImage);
}
$resizedImage = Image::make($request->img_perfil)->resize(500, null, function ($constraint) {
$constraint->aspectRatio();
});
$resizedImage = Image::read($request->img_perfil)->scale(500, null);
// Gerar um nome único para a imagem
$imageName = Str::uuid().'.'.$request->img_perfil->getClientOriginalExtension();
// Salvar a imagem no diretório destinado a imagens de perfil
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Os/OsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class OsController extends Controller
{
public function __construct(
private readonly ?OsService $osService = null
private readonly OsService $osService
) {
// ACL DE PERMISSÕES
$this->middleware('permission:os', ['only' => ['index']]);
Expand All @@ -38,7 +38,7 @@ public function __construct(
public function index(Request $request)
{
$os = $this->osService::getDataTable($request);
ds($os);
// ds($os);

return view('os.index', compact('os', 'request'));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Venda/VendaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class VendaController extends Controller
{
public function __construct(
private readonly ?VendaService $vendaService = null
private readonly VendaService $vendaService
) {
// ACL DE PERMISSÕES
$this->middleware('permission:venda', ['only' => ['index']]);
Expand Down
12 changes: 8 additions & 4 deletions app/Http/Controllers/Wiki/WikiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,16 @@ public function textUpdate(Request $request, Wiki $wiki)
$wiki->texto = $processedHtml;
$wiki->user_id = Auth::id();
$wiki->save();
$response = [
'text' => 'Wiki atualizada com sucesso.',
];

return response()->json($response, 200);
// 1. Cria a notificação
flash()->success('Wiki atualizada com sucesso!');

// 2. Retorna os DADOS da notificação em formato JSON
return response()->json([
'flash' => flash()->render('json'),
]);
} catch (\Throwable $th) {
ds($th);
$response = [
'text' => 'Ouve um erro, recarregue a pagina e tente novamente',
];
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Checklist/ChecklistTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function submit($formData): void
$this->os->checklistData()->delete();
$this->os->checklistData()->createMany($checklistFormData);
DB::commit();
flasher('Checklist atualizado com sucesso.');
flash('Checklist atualizado com sucesso.');
} catch (\Throwable $th) {
DB::rollBack();
throw $th;
Expand Down
8 changes: 4 additions & 4 deletions app/Livewire/Financeiro/AddPagamentoModal.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function pagamentoCreate(): void
{
$pagamentoRequest = $this->validate();
if ($this->modelSelector()->quitada()) {
flash()->addError('a OS ja foi Quitada!');
flash()->error('a OS ja foi Quitada!');

return;
}
Expand Down Expand Up @@ -129,13 +129,13 @@ protected function disparaMensagemPosPagamento(): void
if ($this->modelSelector()->quitada()) {
$this->dispatch('toggleAddPagamentoModal');
if ($this->typeSelector() === 'os') {
flasher('Pagamento adicionado com sucesso, o status da Ordem de Serviço foi alterado para '.Status::find($this->modelSelector()->status_id)->name.'!');
flash('Pagamento adicionado com sucesso, o status da Ordem de Serviço foi alterado para '.Status::find($this->modelSelector()->status_id)->name.'!');
}
if ($this->typeSelector() === 'venda') {
flasher('Pagamento adicionado com sucesso, o status da Venda foi alterado para '.Status::find($this->modelSelector()->status_id)->name.'!');
flash('Pagamento adicionado com sucesso, o status da Venda foi alterado para '.Status::find($this->modelSelector()->status_id)->name.'!');
}
} else {
flasher('Pagamento adicionado com sucesso.');
flash('Pagamento adicionado com sucesso.');
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Os/Informacoes/DeleteButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function delete($informacao_id): void
}
$informacao->delete();
$this->dispatch('closeModal');
flasher('Anotação removida com sucesso.');
flash('Anotação removida com sucesso.');
$this->dispatch('updateInformacoesTable');
} catch (\Throwable $th) {
throw $th;
Expand Down
6 changes: 3 additions & 3 deletions app/Livewire/Os/InformacoesTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function anotacaoCreate(): void
DB::commit();
$this->dispatch('closeModal');
$this->anotacao = '';
flasher('Anotação adicionada com sucesso.');
flash('Anotação adicionada com sucesso.');
} catch (\Throwable $th) {
DB::rollBack();
throw $th;
Expand Down Expand Up @@ -98,7 +98,7 @@ public function senhaCreate(): void
$this->tipo_senha = 'texto';

$this->dispatch('closeModal');
flasher('Senha adicionada com sucesso.');
flash('Senha adicionada com sucesso.');
} catch (\Throwable $th) {
DB::rollBack();
throw $th;
Expand Down Expand Up @@ -137,7 +137,7 @@ public function arquivoCreate(): void
]);
$this->descricao_arquivo = '';
$this->dispatch('closeModal');
flasher('Arquivo adicionad com sucesso.');
flash('Arquivo adicionad com sucesso.');
DB::commit();
} catch (\Throwable $th) {
DB::rollBack();
Expand Down
8 changes: 4 additions & 4 deletions app/Livewire/Produto/ProdutoTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function create()
if ($this->modelSelector()->conta_id) {
// Apagando o produto digitado.
$this->dispatch('clear');
flash()->addError('Produto não pode ser adicionado se Faturado.');
flash()->error('Produto não pode ser adicionado se Faturado.');
} else {
$this->createItemProduto($produto);
$this->quantidade = null;
Expand All @@ -78,7 +78,7 @@ public function create()
$this->produto_id = null;
// Apagando o produto digitado.
$this->dispatch('clear');
flasher('Produto adicionado com sucesso.');
flash('Produto adicionado com sucesso.');
}
}

Expand All @@ -88,11 +88,11 @@ public function delete($id)
if ($this->modelSelector()->conta_id) {
// Apagando o produto digitado.
$this->dispatch('clear');
flash()->addError('Produto não pode ser removido se Faturado.');
flash()->error('Produto não pode ser removido se Faturado.');
} else {
$itemProduto = $this->modelSelector()->produtos()->findOrFail($id);
$itemProduto->delete();
flasher('Produto removido com sucesso.');
flash('Produto removido com sucesso.');
}
} catch (\Throwable $th) {
throw $th;
Expand Down
8 changes: 4 additions & 4 deletions app/Livewire/Servico/ServicoTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function create(): void
if ($this->os->conta_id) {
// Apagando o produto digitado.
$this->dispatch('clear');
flash()->addError('Serviço não pode ser adicionado a uma os Faturada.');
flash()->error('Serviço não pode ser adicionado a uma os Faturada.');
} else {
$this->createOsServico($servico);

Expand All @@ -73,7 +73,7 @@ public function create(): void

// Apagando o serviço digitado.
$this->dispatch('clear');
flasher('Serviço adicionado com sucesso.');
flash('Serviço adicionado com sucesso.');
}
}

Expand All @@ -83,11 +83,11 @@ public function delete($id)
if ($this->os->conta_id) {
// Apagando o produto digitado.
$this->dispatch('clear');
flash()->addError('Serviço não pode ser apagado a uma os Faturada.');
flash()->error('Serviço não pode ser apagado a uma os Faturada.');
} else {
$osServico = $this->os->servicos()->find($id);
$osServico->delete();
flasher('Serviço removido com sucesso.');
flash('Serviço removido com sucesso.');
}
} catch (\Throwable $th) {
throw $th;
Expand Down
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
"license": "MIT",
"require": {
"php": "^8.2",
"barryvdh/laravel-dompdf": "^2.2",
"diglactic/laravel-breadcrumbs": "^9.0",
"barryvdh/laravel-dompdf": "^3.1",
"diglactic/laravel-breadcrumbs": "^10.0",
"guzzlehttp/guzzle": "^7.2",
"intervention/image": "^2.7",
"intervention/image-laravel": "*",
"jeroennoten/laravel-adminlte": "^3.9",
"laravel/framework": "^11.0",
"laravel/framework": "^12.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"laravellegends/pt-br-validator": "^11.0",
"laravellegends/pt-br-validator": "^12.0",
"livewire/livewire": "^3.4",
"opcodesio/log-viewer": "^3.15",
"php-flasher/flasher-laravel": "^1.15",
"spatie/laravel-backup": "^8.6",
"php-flasher/flasher-laravel": "^2.1",
"spatie/laravel-backup": "^9.3",
"spatie/laravel-html": "^3.2",
"spatie/laravel-permission": "^6.00",
"tightenco/ziggy": "^1.6",
"yaza/laravel-google-drive-storage": "^3.0"
"tightenco/ziggy": "^2.5",
"yaza/laravel-google-drive-storage": "^4.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.13",
Expand All @@ -33,6 +33,7 @@
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^8.1",
"pestphp/pest": "^3.8",
"phpunit/phpunit": "^11.1",
"spatie/laravel-ignition": "^2.0"
},
Expand Down
Loading