-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
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
Binary file not shown.
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,23 @@ | ||
<?php | ||
|
||
namespace Modules\Base\Services\Concerns; | ||
|
||
trait HasResource | ||
{ | ||
/** | ||
* @var ?array | ||
* @example 'groupId' | ||
*/ | ||
public ?array $resource = null; | ||
|
||
/** | ||
* @param ?string $resource | ||
* @return $this | ||
*/ | ||
public function resource(?string $resource): static | ||
{ | ||
$data = app($resource)->query(request(), $this->rows, false); | ||
$this->resource = app($resource)->response($this->rows, $data, app($resource)->table); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Modules\Base\Services\Rows; | ||
|
||
use Modules\Base\Services\Concerns\HasResource; | ||
use Modules\Base\Services\Rows\Abstracts\Base; | ||
|
||
class RelationManager extends Base | ||
{ | ||
use HasResource; | ||
|
||
public string $vue = "ViltRelationManager.vue"; | ||
|
||
/** | ||
* @param string $name | ||
* @return static | ||
*/ | ||
public static function make(string $name): self | ||
{ | ||
return (new self)->name($name); | ||
} | ||
} |
Binary file not shown.