-
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.
Added debug bar in as using website now
- Loading branch information
1 parent
1d16ccb
commit 5818174
Showing
16 changed files
with
882 additions
and
477 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
namespace FullRent\Core\Application\Http\Composer; | ||
|
||
use FullRent\Core\Application\Http\Composer\Dashboard\AllDashboardComposer; | ||
use Illuminate\Contracts\View\Factory; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
/** | ||
* Class ComposeServiceProvider | ||
* @package FullRent\Core\Application\Http\Composer | ||
* @author Simon Bennett <simon@bennett.im> | ||
*/ | ||
final class ComposeServiceProvider extends ServiceProvider | ||
{ | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
|
||
} | ||
|
||
public function boot() | ||
{ | ||
/** @var Factory $view */ | ||
$view = $this->app->make('Illuminate\Contracts\View\Factory'); | ||
$view->composer('dashboard.*', AllDashboardComposer::class); | ||
|
||
} | ||
} |
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,17 @@ | ||
<?php | ||
namespace FullRent\Core\Application\Http\Composer; | ||
|
||
use Illuminate\Contracts\View\View; | ||
|
||
/** | ||
* Interface Composer | ||
* @package FullRent\Core\Application\Http\Composer | ||
* @author Simon Bennett <simon@bennett.im> | ||
*/ | ||
interface Composer | ||
{ | ||
/** | ||
* @param View $view | ||
*/ | ||
public function compose(View $view); | ||
} |
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 | ||
namespace FullRent\Core\Application\Http\Composer\Dashboard; | ||
|
||
use FullRent\Core\Application\Http\Composer\Composer; | ||
use FullRent\Core\QueryBus\QueryBus; | ||
use FullRent\Core\User\Queries\FindUserById; | ||
use Illuminate\Contracts\Auth\Guard; | ||
use Illuminate\Contracts\Cache\Repository; | ||
use Illuminate\Contracts\View\View; | ||
|
||
/** | ||
* Class AllDashboardComposer | ||
* @package FullRent\Core\Application\Http\Composer\Dashboard | ||
* @author Simon Bennett <simon@bennett.im> | ||
*/ | ||
final class AllDashboardComposer implements Composer | ||
{ | ||
/** @var Guard */ | ||
private $guard; | ||
|
||
/** @var QueryBus */ | ||
private $queryBus; | ||
|
||
/** @var Repository */ | ||
private $cache; | ||
|
||
/** | ||
* AllDashboardComposer constructor. | ||
* @param Guard $guard | ||
* @param QueryBus $queryBus | ||
* @param Repository $cache | ||
*/ | ||
public function __construct(Guard $guard, QueryBus $queryBus, Repository $cache) | ||
{ | ||
$this->guard = $guard; | ||
$this->queryBus = $queryBus; | ||
$this->cache = $cache; | ||
} | ||
|
||
/** | ||
* @param View $view | ||
*/ | ||
public function compose(View $view) | ||
{ | ||
|
||
$user = $this->cache->remember('user-' . $this->guard->user()->id, | ||
1, | ||
function () { | ||
return $this->queryBus->query(new FindUserById($this->guard->user()->id)); | ||
}); | ||
$view->with('currentUser', $user); | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.