Skip to content

Commit

Permalink
Merge pull request #5 from queents/dev
Browse files Browse the repository at this point in the history
add api for option  feature
  • Loading branch information
3x1io authored Oct 20, 2022
2 parents 76e2447 + b12a269 commit 3d92a70
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Services/Components/Actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function get(): mixed
->label($this->label)
->type($this->type)
->icon($this->icon)
->action($this->action)
->action($this->action, $this->actionMethod)
->modal($this->modal)
->confirmed($this->confirmed)
->url($this->url)
Expand Down
32 changes: 32 additions & 0 deletions Services/Concerns/HasApi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Modules\Base\Services\Concerns;

trait HasApi
{
/**
* @var ?string
*/
public ?string $apiRow = null;
/**
* @var ?string
*/
public ?string $apiModel = null;
/**
* @var ?string
*/
public ?string $apiLabel = null;
/**
* @var ?string
*/
public ?string $apiQuery = null;

public function api(string | null $apiRow, string | null $apiModel,string | null $apiLabel=null, string | null $apiQuery=null): static
{
$this->apiRow = $apiRow;
$this->apiModel = $apiModel;
$this->apiLabel = $apiLabel;
$this->apiQuery = $apiQuery;
return $this;
}
}
4 changes: 3 additions & 1 deletion Services/Rows/Abstracts/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Base\Services\Rows\Abstracts;

use Modules\Base\Services\Concerns\HasAdd;
use Modules\Base\Services\Concerns\HasApi;
use Modules\Base\Services\Concerns\HasColor;
use Modules\Base\Services\Concerns\HasDefault;
use Modules\Base\Services\Concerns\HasDescription;
Expand Down Expand Up @@ -45,6 +46,7 @@ abstract class Base implements Component
use HasName;
use HasLabel;
use HasDefault;
use HasApi;
use HasRoles;
use HasPlaceholder;
use HasHint;
Expand Down Expand Up @@ -79,4 +81,4 @@ abstract class Base implements Component
use IsMoney;
use IsSortable;
use IsBadge;
}
}

0 comments on commit 3d92a70

Please sign in to comment.