Added a condition in the "IconColumn" class
This commit is contained in:
@@ -4,10 +4,7 @@ namespace App\Tables\Extensions;
|
|||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Mmt\GenericTable\Attributes\MappedRoute;
|
use Mmt\GenericTable\Attributes\MappedRoute;
|
||||||
use Mmt\GenericTable\Components\Column;
|
|
||||||
use Mmt\GenericTable\Enums\ColumnSettingFlags;
|
|
||||||
use Mmt\GenericTable\Interfaces\IColumn;
|
use Mmt\GenericTable\Interfaces\IColumn;
|
||||||
use Mmt\GenericTable\Interfaces\IColumnFormatter;
|
|
||||||
use Mmt\GenericTable\Interfaces\IColumnRenderer;
|
use Mmt\GenericTable\Interfaces\IColumnRenderer;
|
||||||
use Str;
|
use Str;
|
||||||
|
|
||||||
@@ -15,8 +12,6 @@ class IconColumn implements IColumn, IColumnRenderer
|
|||||||
{
|
{
|
||||||
public int $settings = 0;
|
public int $settings = 0;
|
||||||
|
|
||||||
public string $bindedRoute = '';
|
|
||||||
|
|
||||||
public ?MappedRoute $mappedRoute = null;
|
public ?MappedRoute $mappedRoute = null;
|
||||||
|
|
||||||
public ?string $databaseColumnName = 'status';
|
public ?string $databaseColumnName = 'status';
|
||||||
@@ -33,6 +28,8 @@ class IconColumn implements IColumn, IColumnRenderer
|
|||||||
|
|
||||||
public function renderCell(\Illuminate\Database\Eloquent\Model $rowModel): string
|
public function renderCell(\Illuminate\Database\Eloquent\Model $rowModel): string
|
||||||
{
|
{
|
||||||
|
$icon = 'bi bi-arrow-up-right-circle-fill';
|
||||||
|
if(isset($this->setIconCallback))
|
||||||
$icon = $this->setIconCallback->call($this, $rowModel);
|
$icon = $this->setIconCallback->call($this, $rowModel);
|
||||||
|
|
||||||
return <<<HTML
|
return <<<HTML
|
||||||
|
|||||||
Reference in New Issue
Block a user