-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* No Domain reads: Character display through Eloquent. * No Domain reads: Using Eloquent model for Character read operations. * No Domain reads: Removing ContainsModel trait. * Refactoring battle turn creation. # Conflicts: # app/Modules/Battle/Domain/Entities/BattleRound.php * Refactoring Battle generation. # Conflicts: # app/Modules/Battle/Domain/Entities/Battle.php * Refactoring Battle generation. # Conflicts: # app/Modules/Battle/Domain/Entities/Battle.php
- Loading branch information
Showing
34 changed files
with
191 additions
and
339 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
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,39 @@ | ||
<?php | ||
|
||
namespace App\Http\ViewComposers; | ||
|
||
use App\Character; | ||
use App\Modules\Level\Domain\Services\LevelService; | ||
use Illuminate\Support\Arr; | ||
use Illuminate\View\View; | ||
|
||
class CharacterGeneralInfoComposer | ||
{ | ||
/** | ||
* @var LevelService | ||
*/ | ||
private $levelService; | ||
|
||
public function __construct(LevelService $levelService) | ||
{ | ||
$this->levelService = $levelService; | ||
} | ||
|
||
/** | ||
* Bind data to the view. | ||
* | ||
* @param View $view | ||
* @return void | ||
*/ | ||
public function compose(View $view) | ||
{ | ||
$data = $view->getData(); | ||
|
||
/** @var Character $character */ | ||
$character = Arr::get($data, 'character'); | ||
|
||
$level = $this->levelService->getLevel($character->getLevelNumber()); | ||
|
||
$view->with(compact('character', 'level')); | ||
} | ||
} |
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
Oops, something went wrong.