<?php
namespace App\Livewire\Company;
class CompanyList extends Component implements Forms\Contracts\HasForms, Tables\Contracts\HasTable
{
use Forms\Concerns\InteractsWithForms;
use Tables\Concerns\InteractsWithTable;
public User $user;
public function table(Table $table): Table
{
return $table
->relationship(fn (): HasMany => $this->user->companies())
->columns([
Tables\Columns\ImageColumn::make('company_logo_path')
->label('Company Logo'),
Tables\Columns\TextColumn::make('name')
->label(__('translations.field.company_name')),
Tables\Columns\TextColumn::make('email')
->label(__('translations.field.email')),
Tables\Columns\TextColumn::make('location')
->label(__('translations.field.location')),
]),
//
}
public function render(): View
{
return view('livewire.company.company-list')->layout('layouts.profile-layout');
}
}