-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move exportTrait to ExportAction refactoring minor fixes
- Loading branch information
Showing
44 changed files
with
506 additions
and
374 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace Leeto\MoonShine\Actions; | ||
|
||
use Leeto\MoonShine\Contracts\Actions\ActionContract; | ||
use Leeto\MoonShine\Contracts\Resources\ResourceContract; | ||
|
||
class BaseAction | ||
{ | ||
protected string $label; | ||
|
||
protected ResourceContract|null $resource; | ||
|
||
public static function make(...$arguments): static | ||
{ | ||
return new static(...$arguments); | ||
} | ||
|
||
final public function __construct(string $label) | ||
{ | ||
$this->setLabel($label); | ||
} | ||
|
||
public function label(): string | ||
{ | ||
return $this->label; | ||
} | ||
|
||
public function setLabel(string $label): static | ||
{ | ||
$this->label = $label; | ||
|
||
return $this; | ||
} | ||
|
||
public function resource(): ResourceContract|null | ||
{ | ||
return $this->resource; | ||
} | ||
|
||
public function setResource(ResourceContract $resource): static | ||
{ | ||
$this->resource = $resource; | ||
|
||
return $this; | ||
} | ||
} |
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
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,12 @@ | ||
<?php | ||
|
||
namespace Leeto\MoonShine\Contracts\Actions; | ||
|
||
interface ActionContract | ||
{ | ||
public function handle(): mixed; | ||
|
||
public function url(): string; | ||
|
||
public function isTriggered(): bool; | ||
} |
Oops, something went wrong.