Clean up API code.

This commit is contained in:
James Cole
2018-07-05 06:10:35 +02:00
parent 7c3aaf7b7c
commit f6f8bb7fd1
21 changed files with 157 additions and 89 deletions

View File

@@ -53,10 +53,12 @@ class PiggyBankController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
/** @var User $admin */
$admin = auth()->user();
$this->repository = app(PiggyBankRepositoryInterface::class);
$this->repository->setUser($admin);
return $next($request);
}