-
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.
* ♻️ Optimize Card Model * ✨ Introduce model facades * ✨ Introduce alias methods for card model * ✅ Add tests * 📝 Add alias methods to README
- Loading branch information
1 parent
adebaae
commit 1a06e39
Showing
13 changed files
with
642 additions
and
40 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 was deleted.
Oops, something went wrong.
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,30 @@ | ||
<?php | ||
|
||
namespace Slatyo\LaravelPokemontcg\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static mixed find(string $pokemonTcgId) | ||
* @method static mixed search(string $query, int $page = 1, int|string $pageSize = \Slatyo\LaravelPokemontcg\Models\Card::MAXIMUM_PAGE_SIZE, string $orderBy = '') | ||
* @method static mixed name(string $pokemon, bool $strict = false) | ||
* @method static mixed whereName(string $pokemon, bool $strict = false) | ||
* @method static mixed supertype(string $supertype, string $type = '') | ||
* @method static mixed whereSupertype(string $supertype, string $type = '') | ||
* @method static mixed pokedex(string $from, string $to) | ||
* @method static mixed wherePokedex(string $from, string $to) | ||
* @method static mixed hp(string $from, string $to) | ||
* @method static mixed whereHp(string $from, string $to) | ||
*/ | ||
class Card extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pokemontcg-card'; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace Slatyo\LaravelPokemontcg\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static mixed all() | ||
*/ | ||
class Rarity extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pokemontcg-rarity'; | ||
} | ||
} |
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 Slatyo\LaravelPokemontcg\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static mixed find(string $set) | ||
* @method static mixed search(string $query, int $page = 1, int|string $pageSize = \Slatyo\LaravelPokemontcg\Models\Set::MAXIMUM_PAGE_SIZE, string $orderBy = '') | ||
*/ | ||
class Set extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pokemontcg-set'; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace Slatyo\LaravelPokemontcg\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static mixed all() | ||
*/ | ||
class Subtype extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pokemontcg-subtype'; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace Slatyo\LaravelPokemontcg\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static mixed all() | ||
*/ | ||
class Supertype extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pokemontcg-supertype'; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
namespace Slatyo\LaravelPokemontcg\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static mixed all() | ||
*/ | ||
class Type extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return 'pokemontcg-type'; | ||
} | ||
} |
Oops, something went wrong.