mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 20:38:57 +00:00
New code, building a migration routine.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Firefly\Storage\Account;
|
||||
|
||||
|
||||
interface AccountRepositoryInterface
|
||||
{
|
||||
public function count();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Firefly\Storage\Account;
|
||||
|
||||
class EloquentAccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function count() {
|
||||
return \Auth::user()->accounts()->count();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,11 @@ class StorageServiceProvider extends ServiceProvider
|
||||
'Firefly\Storage\User\UserRepositoryInterface',
|
||||
'Firefly\Storage\User\EloquentUserRepository'
|
||||
);
|
||||
|
||||
$this->app->bind(
|
||||
'Firefly\Storage\Account\AccountRepositoryInterface',
|
||||
'Firefly\Storage\Account\EloquentAccountRepository'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,4 +41,13 @@ class EloquentUserRepository implements UserRepositoryInterface
|
||||
return \User::where('verification', $verification)->first();
|
||||
}
|
||||
|
||||
public function findByReset($reset)
|
||||
{
|
||||
return \User::where('reset', $reset)->first();
|
||||
}
|
||||
public function findByEmail($email)
|
||||
{
|
||||
return \User::where('email', $email)->first();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,9 +7,13 @@ namespace Firefly\Storage\User;
|
||||
interface UserRepositoryInterface
|
||||
{
|
||||
public function register();
|
||||
|
||||
public function auth();
|
||||
|
||||
public function findByVerification($verification);
|
||||
public function findByReset($reset);
|
||||
|
||||
public function findByEmail($email);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user