-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #453 from AnimeThemes/audios
Audios Release
- Loading branch information
Showing
332 changed files
with
18,051 additions
and
5,125 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 |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
|
||
/.github export-ignore | ||
CHANGELOG.md export-ignore | ||
.styleci.yml export-ignore |
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,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions; | ||
|
||
use App\Enums\Actions\ActionStatus; | ||
|
||
/** | ||
* Class ActionResult. | ||
*/ | ||
class ActionResult | ||
{ | ||
/** | ||
* Create a new action result instance. | ||
* | ||
* @param ActionStatus $status | ||
* @param string|null $message | ||
*/ | ||
public function __construct(protected readonly ActionStatus $status, protected readonly ?string $message = null) | ||
{ | ||
} | ||
|
||
/** | ||
* Get the action result status. | ||
* | ||
* @return ActionStatus | ||
*/ | ||
public function getStatus(): ActionStatus | ||
{ | ||
return $this->status; | ||
} | ||
|
||
/** | ||
* Get the action result message. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getMessage(): ?string | ||
{ | ||
return $this->message; | ||
} | ||
|
||
/** | ||
* Has the action failed? | ||
* | ||
* @return bool | ||
*/ | ||
public function hasFailed(): bool | ||
{ | ||
return ActionStatus::FAILED()->is($this->status); | ||
} | ||
} |
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,58 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Actions\Models; | ||
|
||
use App\Actions\ActionResult; | ||
use App\Models\BaseModel; | ||
use Illuminate\Database\Eloquent\Relations\Relation; | ||
use Illuminate\Support\Str; | ||
|
||
/** | ||
* Class BaseAction. | ||
* | ||
* @template TModel of \App\Models\BaseModel | ||
*/ | ||
abstract class BaseAction | ||
{ | ||
/** | ||
* Create a new action instance. | ||
* | ||
* @param TModel $model | ||
*/ | ||
public function __construct(protected BaseModel $model) | ||
{ | ||
} | ||
|
||
/** | ||
* Handle action. | ||
* | ||
* @return ActionResult | ||
*/ | ||
abstract public function handle(): ActionResult; | ||
|
||
/** | ||
* Get the model the action is handling. | ||
* | ||
* @return TModel | ||
*/ | ||
abstract protected function getModel(): BaseModel; | ||
|
||
/** | ||
* Get the relation to resources. | ||
* | ||
* @return Relation | ||
*/ | ||
abstract protected function relation(): Relation; | ||
|
||
/** | ||
* Get the human-friendly label for the underlying model. | ||
* | ||
* @return string | ||
*/ | ||
protected function label(): string | ||
{ | ||
return Str::headline(class_basename($this->getModel())); | ||
} | ||
} |
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
Oops, something went wrong.