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
{"lastUpload":"2020-03-24T03:32:23.893Z","extensionVersion":"v3.4.3"} |
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
<?php | |
// A nice simple route to show a pokemons name if we can find it using our Service | |
// 一個簡單的路由去顯示 pokemon 名稱,我們可以發現它使用我們的服務去取得 pokemon 資料 | |
Route::any('/pokemon/{pokemon}', function($pokemon) { | |
return Pokemon::getPokemon($pokemon); | |
}); |
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
<?php | |
// A nice simple route to show a pokemons name if we can find it using our Service | |
Route::any('/pokemon/{pokemon}', function($pokemon) { | |
return Pokemon::getPokemon($pokemon); | |
}); |
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
<?php | |
// app/database/migrations/2015_01_25_085024_create_pokemon_table.php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreatePokemonTable extends Migration { | |
/** | |
* Run the migrations. |
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
<?php | |
// app/config/app.php | |
// .... | |
'aliases' => array( | |
'Pokemon' => 'Services\Pokemon\PokemonFacade', | |
), |
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
<?php | |
// app/config/app.php | |
// .... | |
'providers' => array( | |
'Repositories\Pokemon\PokemonRepositoryServiceProvider', | |
'Services\Pokemon\PokemonServiceServiceProvider', | |
), |
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
"autoload": { | |
"classmap": [ | |
"app/models/entities", | |
"app/models/repositories", | |
"app/models/repositories/pokemon", | |
"app/models/services", | |
"app/models/services/pokemon", | |
] | |
}, |
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
<?php namespace Services\Pokemon; | |
// model/Services/Pokemon/PokemonFacade.php | |
use \Illuminate\Support\Facades\Facade; | |
/** | |
* Facade class to be called whenever the class PokemonService is called | |
* Facade 類別當 PokemonService 被呼叫時呼叫 | |
*/ | |
class PokemonFacade extends Facade { |
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
<?php namespace Services\Pokemon; | |
// model/Services/Pokemon/PokemonService.php | |
use Repositories\Pokemon\PokemonInterface; | |
/** | |
* Our PokemonService, containing all useful methods for business logic around Pokemon | |
* 我們的 PokemonService 服務,包含所有在 Pokemon 的商業邏輯中有用的方法 | |
*/ | |
class PokemonService |
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
<?php namespace Services\Pokemon; | |
// model/Services/Pokemon/PokemonServiceServiceProvider.php | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* Register our pokemon service with Laravel | |
* 註冊我們的 pokemon 服務到 Laravel | |
*/ | |
class PokemonServiceServiceProvider extends ServiceProvider |
NewerOlder