-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
297 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
use Illuminate\Database\Eloquent\Relations\Pivot; | ||
|
||
class ServicePivot extends Pivot | ||
{ | ||
public $timestamps = false; | ||
|
||
protected $table = 'model_has_services'; | ||
|
||
protected $fillable = [ | ||
'model_type', | ||
'service_id', | ||
'is_visible', | ||
'is_available', | ||
]; | ||
|
||
protected $casts = [ | ||
'is_visible' => 'boolean', | ||
'is_available' => 'boolean', | ||
]; | ||
|
||
protected $with = [ | ||
'service', | ||
]; | ||
|
||
public function service(): BelongsTo | ||
{ | ||
return $this->belongsTo(Service::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Tables\Columns; | ||
|
||
use Closure; | ||
use Filament\Tables\Columns\Column; | ||
use Filament\Tables\Columns\Concerns; | ||
|
||
class ServiceChipsColumn extends Column | ||
{ | ||
use Concerns\HasColor; | ||
|
||
protected string $view = 'tables.columns.service-chips-column'; | ||
|
||
protected string | Closure | null $size = null; | ||
|
||
public function size(string | Closure | null $size): static | ||
{ | ||
$this->size = $size; | ||
|
||
return $this; | ||
} | ||
|
||
public function getSize(mixed $state): string | null | ||
{ | ||
return $this->evaluate($this->size, [ | ||
'state' => $state, | ||
]); | ||
} | ||
} |
Oops, something went wrong.