diff --git a/app/Livewire/PhaseProgress.php b/app/Livewire/PhaseProgress.php index 33c4e9e..0990166 100644 --- a/app/Livewire/PhaseProgress.php +++ b/app/Livewire/PhaseProgress.php @@ -3,8 +3,10 @@ namespace App\Livewire; use Livewire\Component; +use Livewire\Attributes\Layout; use App\Models\Phase; +#[Layout('layouts.app')] class PhaseProgress extends Component { public Phase $phase; diff --git a/app/Livewire/ProjectList.php b/app/Livewire/ProjectList.php index 52e3fb3..4b5ff40 100644 --- a/app/Livewire/ProjectList.php +++ b/app/Livewire/ProjectList.php @@ -4,9 +4,11 @@ namespace App\Livewire; use Livewire\Component; use Livewire\WithPagination; +use Livewire\Attributes\Layout; use App\Models\Project; use Illuminate\Support\Facades\Auth; +#[Layout('layouts.app')] class ProjectList extends Component { use WithPagination; diff --git a/app/Livewire/Reports/ReportsDashboard.php b/app/Livewire/Reports/ReportsDashboard.php index 03b3417..f6bcb9d 100644 --- a/app/Livewire/Reports/ReportsDashboard.php +++ b/app/Livewire/Reports/ReportsDashboard.php @@ -3,11 +3,13 @@ namespace App\Livewire\Reports; use Livewire\Component; +use Livewire\Attributes\Layout; use App\Models\Project; use App\Models\Phase; use App\Models\Inspection; use Carbon\Carbon; +#[Layout('layouts.app')] class ReportsDashboard extends Component { public $dateRange = 'month'; // week, month, quarter, year diff --git a/bootstrap/app.php b/bootstrap/app.php index a538094..0976f79 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -12,6 +12,13 @@ return Application::configure(basePath: dirname(__DIR__)) ) ->withMiddleware(function (Middleware $middleware): void { $middleware->appendToGroup('web', \App\Http\Middleware\SetLocale::class); + + // Spatie permission middleware aliases + $middleware->alias([ + 'role' => \Spatie\Permission\Middleware\RoleMiddleware::class, + 'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class, + 'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class, + ]); }) ->withExceptions(function (Exceptions $exceptions): void { // diff --git a/resources/views/livewire/company-form.blade.php b/resources/views/livewire/company-form.blade.php index 99118bb..25ecdc2 100644 --- a/resources/views/livewire/company-form.blade.php +++ b/resources/views/livewire/company-form.blade.php @@ -1,246 +1,246 @@
- -
- - - -

- {{ $company ? 'Editar empresa: ' . $company->name : 'Nueva empresa' }} -

-
-
+ +
+ + + +

+ {{ $company ? 'Editar empresa: ' . $company->name : 'Nueva empresa' }} +

+
+
-
-
+
+
- @if(session('notify')) -
{{ session('notify') }}
- @endif + @if(session('notify')) +
{{ session('notify') }}
+ @endif -
-
+
+
-
+ - @if($errors->any()) -
- -
    - @foreach($errors->all() as $e)
  • {{ $e }}
  • @endforeach -
-
- @endif - - {{-- ── Macro para fila de formulario horizontal ──────────── --}} - {{-- Patrón: flex row, label w-48 shrink-0, campo flex-1 --}} - - {{-- ── Sección: Identificación ──────────────────────────── --}} -
-

- Identificación -

-
- -
- -
- - @error('name')

{{ $message }}

@enderror + @if($errors->any()) +
+ +
    + @foreach($errors->all() as $e)
  • {{ $e }}
  • @endforeach +
-
+ @endif -
- -
- -
-
+ {{-- ── Macro para fila de formulario horizontal ──────────── --}} + {{-- Patrón: flex row, label w-48 shrink-0, campo flex-1 --}} -
- -
- - @error('tax_id')

{{ $message }}

@enderror -
-
+ {{-- ── Sección: Identificación ──────────────────────────── --}} +
+

+ Identificación +

+
-
- -
- -
-
- -
- -
- -
-
- -
-
- - {{-- ── Sección: Contacto ─────────────────────────────────── --}} -
-

- Contacto -

-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- - @error('email')

{{ $message }}

@enderror -
-
- -
- -
- - @error('website')

{{ $message }}

@enderror -
-
- -
-
- - {{-- ── Sección: Logo ─────────────────────────────────────── --}} -
-

- Logo -

-
- -
- {{-- Preview --}} - @if($logo) - Preview - @elseif($company?->logo_path && \Illuminate\Support\Facades\Storage::disk('public')->exists($company->logo_path)) - Logo actual - @else -
- +
+ +
+ + @error('name')

{{ $message }}

@enderror +
- @endif -
- -
Subiendo…
- @error('logo')

{{ $message }}

@enderror + +
+ +
+ +
+
+ +
+ +
+ + @error('tax_id')

{{ $message }}

@enderror +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
-
-
- {{-- ── Sección: Notas ────────────────────────────────────── --}} -
-

- Notas internas -

-
- -
- + {{-- ── Sección: Contacto ─────────────────────────────────── --}} +
+

+ Contacto +

+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + @error('email')

{{ $message }}

@enderror +
+
+ +
+ +
+ + @error('website')

{{ $message }}

@enderror +
+
+ +
-
-
- {{-- ── Botones ───────────────────────────────────────────── --}} -
- - - Cancelar - - -
+ {{-- ── Sección: Logo ─────────────────────────────────────── --}} +
+

+ Logo +

+
+ +
+ {{-- Preview --}} + @if($logo) + Preview + @elseif($company?->logo_path && \Illuminate\Support\Facades\Storage::disk('public')->exists($company->logo_path)) + Logo actual + @else +
+ +
+ @endif +
+ +
Subiendo…
+ @error('logo')

{{ $message }}

@enderror +
+
+
+
- + {{-- ── Sección: Notas ────────────────────────────────────── --}} +
+

+ Notas internas +

+
+ +
+ +
+
+
+ + {{-- ── Botones ───────────────────────────────────────────── --}} +
+ + + Cancelar + + +
+ + + +
+
- -
-
diff --git a/resources/views/livewire/projects/project-form.blade.php b/resources/views/livewire/projects/project-form.blade.php index 58eb0a6..3c06c25 100644 --- a/resources/views/livewire/projects/project-form.blade.php +++ b/resources/views/livewire/projects/project-form.blade.php @@ -1,5 +1,5 @@
-
+

{{ $project ? __('Edit Project') : __('New Project') }}