diff --git a/app/Livewire/CompanyManagement.php b/app/Livewire/CompanyManagement.php index 4f2974d..d6d58a6 100644 --- a/app/Livewire/CompanyManagement.php +++ b/app/Livewire/CompanyManagement.php @@ -3,12 +3,14 @@ namespace App\Livewire; use Livewire\Component; +use Livewire\Attributes\Layout; use Livewire\WithFileUploads; use App\Models\Company; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Storage; use Illuminate\Http\Response; +#[Layout('layouts.app')] class CompanyManagement extends Component { use WithFileUploads; @@ -236,6 +238,8 @@ class CompanyManagement extends Component public function render() { - return view('livewire.company-management'); + return view('livewire.company-management', [ + 'companies' => $this->getCompaniesProperty(), + ]); } } \ No newline at end of file diff --git a/app/Livewire/PhaseProgress.php b/app/Livewire/PhaseProgress.php index 1d35524..67561ab 100644 --- a/app/Livewire/PhaseProgress.php +++ b/app/Livewire/PhaseProgress.php @@ -3,9 +3,11 @@ namespace App\Livewire; use Livewire\Component; +use Livewire\Attributes\Layout; use App\Models\Phase; use Illuminate\Support\Facades\Auth; +#[Layout('layouts.app')] class PhaseProgress extends Component { public Phase $phase; diff --git a/app/Livewire/ProjectList.php b/app/Livewire/ProjectList.php index b7277d7..2b3fbc9 100644 --- a/app/Livewire/ProjectList.php +++ b/app/Livewire/ProjectList.php @@ -3,10 +3,12 @@ namespace App\Livewire; use Livewire\Component; +use Livewire\Attributes\Layout; use Livewire\WithPagination; use App\Models\Project; use Illuminate\Support\Facades\Auth; +#[Layout('layouts.app')] class ProjectList extends Component { use WithPagination; diff --git a/app/Livewire/ProjectMap.php b/app/Livewire/ProjectMap.php index 6fbf4b0..f765259 100644 --- a/app/Livewire/ProjectMap.php +++ b/app/Livewire/ProjectMap.php @@ -42,9 +42,6 @@ class ProjectMap extends Component public $showFeatureImages = false; public $featureImageMarkers = []; - // Tab management - public $activeTab = 'edit'; // edit or list - public function mount(Project $project) { $user = Auth::user(); diff --git a/app/Models/User.php b/app/Models/User.php index 832f15d..77e0f2b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -49,6 +49,11 @@ class User extends Authenticatable 'password' => 'hashed', ]; } + public function company() + { + return $this->belongsTo(Company::class); + } + // Many-to-many with projects public function projects() { diff --git a/config/session.php b/config/session.php index f9d71f1..1c530fa 100644 --- a/config/session.php +++ b/config/session.php @@ -169,8 +169,7 @@ return [ | */ - // Default to true in production; set SESSION_SECURE_COOKIE=false in local .env if needed - 'secure' => env('SESSION_SECURE_COOKIE', app()->environment('production')), + 'secure' => env('SESSION_SECURE_COOKIE', env('APP_ENV', 'production') === 'production'), /* |-------------------------------------------------------------------------- diff --git a/resources/views/admin/users.blade.php b/resources/views/admin/users.blade.php index f7cce07..cec97cb 100644 --- a/resources/views/admin/users.blade.php +++ b/resources/views/admin/users.blade.php @@ -15,7 +15,7 @@
- @livewire('admin-users') + @livewire('user-table')
diff --git a/resources/views/livewire/company-management.blade.php b/resources/views/livewire/company-management.blade.php index 7086cbf..1d7edec 100644 --- a/resources/views/livewire/company-management.blade.php +++ b/resources/views/livewire/company-management.blade.php @@ -1,327 +1,21 @@
-
-

- - - - {{ __('Company Management') }} -

-

{{ __('Manage the companies that participate in projects') }}

-
- @if(session('message')) -
+
+ {{ session('message') }}
@endif -
- - -
-
- -
-
- -
-
- - -
-
-
-

- {{ $editingCompanyId ? __('Edit Company') : __('New Company') }} -

-

- {{ __('Complete the company information. Fields marked with * are required.') }} -

-
- - @if($errors->any()) -
- {{ __('Validation errors') }}: -
    - @foreach($errors->all() as $error) -
  • {{ $error }}
  • - @endforeach -
-
- @endif - -
- -
-
- - -
- -
- - -
-
-
- -
-
- - -
-
- - -
-
-
- -
-
- - -
- -
- - -
-
- -
-
- - -
- -
- - -
-
- -
-
- - -
- -
- -
- - - @if($logo) -
- {{ __('Logo preview') }} - -
- @endif -
-
-
- -
- - -
- -
- - -
- -
-
- - -
-
-

- - - - {{ __('Company list') }} ({{ $companies->count() }}) -

-
- - @if($companies->isEmpty()) -
- - - -

{{ __('No companies registered. Create your first company using the button above.') }}

-
- @else -
- @foreach($companies as $company) -
-
-
- @if($company->logo_path && Storage::disk('public')->exists($company->logo_path)) - {{ __('Logo of') }} {{ $company->name }} - @else -
- - - -
- @endif -
-

{{ $company->name }}

-

- @if($company->tax_id) - {{ $company->tax_id }} - @else - {{ __('No tax ID') }} - @endif -

- @if($company->type) - - {{ ucfirst($company->type) }} - - @endif -
-
-
- -
-
- @if($company->address) -
- - - - {{ $company->address }} -
- @endif - @if($company->phone) -
- - - - {{ $company->phone }} -
- @endif - @if($company->email) -
- - - - {{ $company->email }} -
- @endif -
- -
- - -
-
-
- @if(!$loop->last) -
- @endforeach -
- @endif +
+
+

{{ __('Company Management') }}

+

{{ __('Manage the companies that participate in projects') }}

+ + + {{ __('New Company') }} +
+ +
diff --git a/resources/views/livewire/projects/project-list.blade.php b/resources/views/livewire/projects/project-list.blade.php index d80bd69..a7c0d98 100644 --- a/resources/views/livewire/projects/project-list.blade.php +++ b/resources/views/livewire/projects/project-list.blade.php @@ -1,51 +1,3 @@
-
- - - @can('create projects') - + {{ __('New Project') }} - @endcan -
- -
- - - - - - @foreach($projects as $project) - - - - - - - - @endforeach - -
{{ __('Name') }}{{ __('Address') }}{{ __('Status') }}{{ __('Progress') }}{{ __('Actions') }}
{{ $project->name }}{{ $project->address }}{{ __(ucfirst(str_replace('_', ' ', $project->status))) }} -
-
-
-
- - - Dashboard - - - - {{ __('Map') }} - - @can('edit projects') - {{ __('Edit') }} - @endcan -
-
- {{ $projects->links() }} +