mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Code cleanup.
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
<?php namespace FireflyIII\Commands;
|
<?php namespace FireflyIII\Commands;
|
||||||
|
/**
|
||||||
|
* Class Command
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Commands
|
||||||
|
*/
|
||||||
|
abstract class Command
|
||||||
|
{
|
||||||
|
|
||||||
abstract class Command {
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,33 +2,36 @@
|
|||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
|
||||||
|
|
||||||
class Inspire extends Command {
|
/**
|
||||||
|
* Class Inspire
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Console\Commands
|
||||||
|
*/
|
||||||
|
class Inspire extends Command
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command name.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $name = 'inspire';
|
protected $description = 'Display an inspiring quote';
|
||||||
|
/**
|
||||||
|
* The console command name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $name = 'inspire';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
* @var string
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected $description = 'Display an inspiring quote';
|
public function handle()
|
||||||
|
{
|
||||||
/**
|
$this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL);
|
||||||
* Execute the console command.
|
}
|
||||||
*
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,27 +3,35 @@
|
|||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
|
||||||
class Kernel extends ConsoleKernel {
|
/**
|
||||||
|
* Class Kernel
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Console
|
||||||
|
*/
|
||||||
|
class Kernel extends ConsoleKernel
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Artisan commands provided by your application.
|
* The Artisan commands provided by your application.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $commands = [
|
protected $commands
|
||||||
'FireflyIII\Console\Commands\Inspire',
|
= [
|
||||||
];
|
'FireflyIII\Console\Commands\Inspire',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
* @return void
|
*
|
||||||
*/
|
* @return void
|
||||||
protected function schedule(Schedule $schedule)
|
*/
|
||||||
{
|
protected function schedule(Schedule $schedule)
|
||||||
$schedule->command('inspire')
|
{
|
||||||
->hourly();
|
$schedule->command('inspire')
|
||||||
}
|
->hourly();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
<?php namespace FireflyIII\Events;
|
<?php namespace FireflyIII\Events;
|
||||||
|
|
||||||
abstract class Event {
|
/**
|
||||||
|
* Class Event
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Events
|
||||||
|
*/
|
||||||
|
abstract class Event
|
||||||
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,47 +3,54 @@
|
|||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler {
|
/**
|
||||||
|
* Class Handler
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Exceptions
|
||||||
|
*/
|
||||||
|
class Handler extends ExceptionHandler
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of the exception types that should not be reported.
|
* A list of the exception types that should not be reported.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dontReport = [
|
protected $dontReport
|
||||||
'Symfony\Component\HttpKernel\Exception\HttpException'
|
= [
|
||||||
];
|
'Symfony\Component\HttpKernel\Exception\HttpException'
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* Render an exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
* @param \Illuminate\Http\Request $request
|
||||||
*
|
* @param \Exception $e
|
||||||
* @param \Exception $e
|
*
|
||||||
* @return void
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function report(Exception $e)
|
public function render($request, Exception $e)
|
||||||
{
|
{
|
||||||
return parent::report($e);
|
if ($this->isHttpException($e)) {
|
||||||
}
|
return $this->renderHttpException($e);
|
||||||
|
} else {
|
||||||
|
return parent::render($request, $e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render an exception into an HTTP response.
|
* Report or log an exception.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||||
* @param \Exception $e
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @param \Exception $e
|
||||||
*/
|
*
|
||||||
public function render($request, Exception $e)
|
* @return void
|
||||||
{
|
*/
|
||||||
if ($this->isHttpException($e))
|
public function report(Exception $e)
|
||||||
{
|
{
|
||||||
return $this->renderHttpException($e);
|
/** @noinspection PhpInconsistentReturnPointsInspection */
|
||||||
}
|
return parent::report($e);
|
||||||
else
|
}
|
||||||
{
|
|
||||||
return parent::render($request, $e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,9 @@ use View;
|
|||||||
*/
|
*/
|
||||||
class AccountController extends Controller
|
class AccountController extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
View::share('mainTitleIcon', 'fa-credit-card');
|
View::share('mainTitleIcon', 'fa-credit-card');
|
||||||
@@ -39,6 +42,11 @@ class AccountController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $what
|
||||||
|
*
|
||||||
|
* @return View
|
||||||
|
*/
|
||||||
public function index($what = 'default')
|
public function index($what = 'default')
|
||||||
{
|
{
|
||||||
$subTitle = Config::get('firefly.subTitlesByIdentifier.' . $what);
|
$subTitle = Config::get('firefly.subTitlesByIdentifier.' . $what);
|
||||||
@@ -49,10 +57,16 @@ class AccountController extends Controller
|
|||||||
return view('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts'));
|
return view('accounts.index', compact('what', 'subTitleIcon', 'subTitle', 'accounts'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param AccountFormRequest $request
|
||||||
|
* @param AccountRepositoryInterface $repository
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
public function store(AccountFormRequest $request, AccountRepositoryInterface $repository)
|
public function store(AccountFormRequest $request, AccountRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
$accountData = [
|
$accountData = [
|
||||||
'name' => $request->input('name') . rand(1,1000),
|
'name' => $request->input('name'),
|
||||||
'accountType' => $request->input('what'),
|
'accountType' => $request->input('what'),
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'user' => Auth::user()->id,
|
'user' => Auth::user()->id,
|
||||||
|
@@ -5,6 +5,11 @@ use Illuminate\Contracts\Auth\Guard;
|
|||||||
use Illuminate\Contracts\Auth\Registrar;
|
use Illuminate\Contracts\Auth\Registrar;
|
||||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AuthController
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Controllers\Auth
|
||||||
|
*/
|
||||||
class AuthController extends Controller
|
class AuthController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -29,7 +34,6 @@ class AuthController extends Controller
|
|||||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||||
*
|
*
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth, Registrar $registrar)
|
public function __construct(Guard $auth, Registrar $registrar)
|
||||||
{
|
{
|
||||||
|
@@ -5,34 +5,40 @@ use Illuminate\Contracts\Auth\Guard;
|
|||||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||||
|
|
||||||
class PasswordController extends Controller {
|
/**
|
||||||
|
* Class PasswordController
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Controllers\Auth
|
||||||
|
*/
|
||||||
|
class PasswordController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Password Reset Controller
|
| Password Reset Controller
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This controller is responsible for handling password reset requests
|
| This controller is responsible for handling password reset requests
|
||||||
| and uses a simple trait to include this behavior. You're free to
|
| and uses a simple trait to include this behavior. You're free to
|
||||||
| explore this trait and override any methods you wish to tweak.
|
| explore this trait and override any methods you wish to tweak.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use ResetsPasswords;
|
use ResetsPasswords;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new password controller instance.
|
* Create a new password controller instance.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||||
* @return void
|
*
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth, PasswordBroker $passwords)
|
public function __construct(Guard $auth, PasswordBroker $passwords)
|
||||||
{
|
{
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->passwords = $passwords;
|
$this->passwords = $passwords;
|
||||||
|
|
||||||
$this->middleware('guest');
|
$this->middleware('guest');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,17 @@
|
|||||||
<?php namespace FireflyIII\Http\Controllers;
|
<?php namespace FireflyIII\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
|
||||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
abstract class Controller extends BaseController {
|
/**
|
||||||
|
* Class Controller
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Controllers
|
||||||
|
*/
|
||||||
|
abstract class Controller extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
use DispatchesCommands, ValidatesRequests;
|
use DispatchesCommands, ValidatesRequests;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Crypt;
|
||||||
use FireflyIII\Http\Requests;
|
use FireflyIII\Http\Requests;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
@@ -11,12 +12,10 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
use Grumpydictator\Gchart\GChart;
|
use Grumpydictator\Gchart\GChart;
|
||||||
use Illuminate\Database\Query\Builder as QueryBuilder;
|
use Illuminate\Database\Query\Builder as QueryBuilder;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
use Response;
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
use Crypt;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GoogleChartController
|
* Class GoogleChartController
|
||||||
@@ -137,6 +136,11 @@ class GoogleChartController extends Controller
|
|||||||
return Response::json($chart->getData());
|
return Response::json($chart->getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param GChart $chart
|
||||||
|
*
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
public function allCategoriesHomeChart(GChart $chart)
|
public function allCategoriesHomeChart(GChart $chart)
|
||||||
{
|
{
|
||||||
$chart->addColumn('Category', 'string');
|
$chart->addColumn('Category', 'string');
|
||||||
@@ -174,6 +178,11 @@ class GoogleChartController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param GChart $chart
|
||||||
|
*
|
||||||
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
|
*/
|
||||||
public function billsOverview(GChart $chart)
|
public function billsOverview(GChart $chart)
|
||||||
{
|
{
|
||||||
$paid = ['items' => [], 'amount' => 0];
|
$paid = ['items' => [], 'amount' => 0];
|
||||||
|
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Kernel
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http
|
||||||
|
*/
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -3,48 +3,51 @@
|
|||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
|
|
||||||
class Authenticate {
|
/**
|
||||||
|
* Class Authenticate
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Middleware
|
||||||
|
*/
|
||||||
|
class Authenticate
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Guard implementation.
|
* The Guard implementation.
|
||||||
*
|
*
|
||||||
* @var Guard
|
* @var Guard
|
||||||
*/
|
*/
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new filter instance.
|
* Create a new filter instance.
|
||||||
*
|
*
|
||||||
* @param Guard $auth
|
* @param Guard $auth
|
||||||
* @return void
|
*
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth)
|
public function __construct(Guard $auth)
|
||||||
{
|
{
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @return mixed
|
*
|
||||||
*/
|
* @return mixed
|
||||||
public function handle($request, Closure $next)
|
*/
|
||||||
{
|
public function handle($request, Closure $next)
|
||||||
if ($this->auth->guest())
|
{
|
||||||
{
|
if ($this->auth->guest()) {
|
||||||
if ($request->ajax())
|
if ($request->ajax()) {
|
||||||
{
|
return response('Unauthorized.', 401);
|
||||||
return response('Unauthorized.', 401);
|
} else {
|
||||||
}
|
return redirect()->guest('auth/login');
|
||||||
else
|
}
|
||||||
{
|
}
|
||||||
return redirect()->guest('auth/login');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,6 @@ use Carbon\Carbon;
|
|||||||
use Closure;
|
use Closure;
|
||||||
use FireflyIII\Exception\FireflyException;
|
use FireflyIII\Exception\FireflyException;
|
||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
use Illuminate\Http\RedirectResponse;
|
|
||||||
use Navigation;
|
use Navigation;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Session;
|
use Session;
|
||||||
@@ -31,7 +30,6 @@ class Range
|
|||||||
*
|
*
|
||||||
* @param Guard $auth
|
* @param Guard $auth
|
||||||
*
|
*
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth)
|
public function __construct(Guard $auth)
|
||||||
{
|
{
|
||||||
|
@@ -4,41 +4,47 @@ use Closure;
|
|||||||
use Illuminate\Contracts\Auth\Guard;
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
|
|
||||||
class RedirectIfAuthenticated {
|
/**
|
||||||
|
* Class RedirectIfAuthenticated
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Middleware
|
||||||
|
*/
|
||||||
|
class RedirectIfAuthenticated
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Guard implementation.
|
* The Guard implementation.
|
||||||
*
|
*
|
||||||
* @var Guard
|
* @var Guard
|
||||||
*/
|
*/
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new filter instance.
|
* Create a new filter instance.
|
||||||
*
|
*
|
||||||
* @param Guard $auth
|
* @param Guard $auth
|
||||||
* @return void
|
*
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth)
|
public function __construct(Guard $auth)
|
||||||
{
|
{
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @return mixed
|
*
|
||||||
*/
|
* @return mixed
|
||||||
public function handle($request, Closure $next)
|
*/
|
||||||
{
|
public function handle($request, Closure $next)
|
||||||
if ($this->auth->check())
|
{
|
||||||
{
|
if ($this->auth->check()) {
|
||||||
return new RedirectResponse(url('/home'));
|
return new RedirectResponse(url('/home'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,18 +3,25 @@
|
|||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||||
|
|
||||||
class VerifyCsrfToken extends BaseVerifier {
|
/**
|
||||||
|
* Class VerifyCsrfToken
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Middleware
|
||||||
|
*/
|
||||||
|
class VerifyCsrfToken extends BaseVerifier
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @return mixed
|
*
|
||||||
*/
|
* @return mixed
|
||||||
public function handle($request, Closure $next)
|
*/
|
||||||
{
|
public function handle($request, Closure $next)
|
||||||
return parent::handle($request, $next);
|
{
|
||||||
}
|
return parent::handle($request, $next);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -12,12 +12,18 @@ use Config;
|
|||||||
*/
|
*/
|
||||||
class AccountFormRequest extends Request
|
class AccountFormRequest extends Request
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
// Only allow logged in users
|
// Only allow logged in users
|
||||||
return Auth::check();
|
return Auth::check();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
$accountRoles = join(',', array_keys(Config::get('firefly.accountRoles')));
|
$accountRoles = join(',', array_keys(Config::get('firefly.accountRoles')));
|
||||||
@@ -29,7 +35,7 @@ class AccountFormRequest extends Request
|
|||||||
'openingBalanceDate' => 'date',
|
'openingBalanceDate' => 'date',
|
||||||
'accountRole' => 'in:' . $accountRoles,
|
'accountRole' => 'in:' . $accountRoles,
|
||||||
'active' => 'boolean',
|
'active' => 'boolean',
|
||||||
'balance_currency_id' => 'required|exists:transaction_currencies,id',
|
'balance_currency_id' => 'exists:transaction_currencies,id',
|
||||||
'what' => 'in:' . $types
|
'what' => 'in:' . $types
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -2,8 +2,14 @@
|
|||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
abstract class Request extends FormRequest {
|
/**
|
||||||
|
* Class Request
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Http\Requests
|
||||||
|
*/
|
||||||
|
abstract class Request extends FormRequest
|
||||||
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* Home Controller
|
* Home Controller
|
||||||
*/
|
*/
|
||||||
Route::group(
|
Route::group(
|
||||||
['middleware' => ['auth','range']], function () {
|
['middleware' => ['auth', 'range']], function () {
|
||||||
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
|
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
|
||||||
Route::get('/prev', ['uses' => 'HomeController@sessionPrev', 'as' => 'sessionPrev']);
|
Route::get('/prev', ['uses' => 'HomeController@sessionPrev', 'as' => 'sessionPrev']);
|
||||||
Route::get('/next', ['uses' => 'HomeController@sessionNext', 'as' => 'sessionNext']);
|
Route::get('/next', ['uses' => 'HomeController@sessionNext', 'as' => 'sessionNext']);
|
||||||
@@ -19,8 +19,8 @@ Route::group(
|
|||||||
Route::get('/accounts/delete/{account}', ['uses' => 'AccountController@delete', 'as' => 'accounts.delete']);
|
Route::get('/accounts/delete/{account}', ['uses' => 'AccountController@delete', 'as' => 'accounts.delete']);
|
||||||
Route::get('/accounts/show/{account}/{view?}', ['uses' => 'AccountController@show', 'as' => 'accounts.show']);
|
Route::get('/accounts/show/{account}/{view?}', ['uses' => 'AccountController@show', 'as' => 'accounts.show']);
|
||||||
Route::post('/accounts/store', ['uses' => 'AccountController@store', 'as' => 'accounts.store']);
|
Route::post('/accounts/store', ['uses' => 'AccountController@store', 'as' => 'accounts.store']);
|
||||||
// Route::post('/accounts/update/{account}', ['uses' => 'AccountController@update', 'as' => 'accounts.update']);
|
// Route::post('/accounts/update/{account}', ['uses' => 'AccountController@update', 'as' => 'accounts.update']);
|
||||||
// Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
|
// Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bills Controller
|
* Bills Controller
|
||||||
|
@@ -22,23 +22,36 @@ class Account extends Model
|
|||||||
'active' => 'required|boolean'
|
'active' => 'required|boolean'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = ['user_id','account_type_id','name','active'];
|
protected $fillable = ['user_id', 'account_type_id', 'name', 'active'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function accountMeta()
|
public function accountMeta()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\AccountMeta');
|
return $this->hasMany('FireflyIII\Models\AccountMeta');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function accountType()
|
public function accountType()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\AccountType');
|
return $this->belongsTo('FireflyIII\Models\AccountType');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param EloquentBuilder $query
|
||||||
|
* @param array $types
|
||||||
|
*/
|
||||||
public function scopeAccountTypeIn(EloquentBuilder $query, array $types)
|
public function scopeAccountTypeIn(EloquentBuilder $query, array $types)
|
||||||
{
|
{
|
||||||
if (is_null($this->joinedAccountTypes)) {
|
if (is_null($this->joinedAccountTypes)) {
|
||||||
@@ -48,11 +61,17 @@ class Account extends Model
|
|||||||
$query->whereIn('account_types.type', $types);
|
$query->whereIn('account_types.type', $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function transactions()
|
public function transactions()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Transaction');
|
return $this->hasMany('FireflyIII\Models\Transaction');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -2,25 +2,44 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AccountMeta
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class AccountMeta extends Model
|
class AccountMeta extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function account()
|
public function account()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\Account');
|
return $this->belongsTo('FireflyIII\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function getDataAttribute($value)
|
public function getDataAttribute($value)
|
||||||
{
|
{
|
||||||
return json_decode($value);
|
return json_decode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at'];
|
return ['created_at', 'updated_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*/
|
||||||
public function setDataAttribute($value)
|
public function setDataAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['data'] = json_encode($value);
|
$this->attributes['data'] = json_encode($value);
|
||||||
|
@@ -2,15 +2,26 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AccountType
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class AccountType extends Model
|
class AccountType extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
//
|
//
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function accounts()
|
public function accounts()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Account');
|
return $this->hasMany('FireflyIII\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at'];
|
return ['created_at', 'updated_at'];
|
||||||
|
@@ -2,19 +2,33 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Bill
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Bill extends Model
|
class Bill extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'date'];
|
return ['created_at', 'updated_at', 'date'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -3,31 +3,51 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Budget
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Budget extends Model
|
class Budget extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function budgetlimits()
|
public function budgetlimits()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\BudgetLimit');
|
return $this->hasMany('FireflyIII\Models\BudgetLimit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||||
|
*/
|
||||||
public function limitrepetitions()
|
public function limitrepetitions()
|
||||||
{
|
{
|
||||||
return $this->hasManyThrough('FireflyIII\Models\LimitRepetition', 'BudgetLimit', 'budget_id');
|
return $this->hasManyThrough('FireflyIII\Models\LimitRepetition', 'BudgetLimit', 'budget_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'budget_transaction_journal', 'budget_id');
|
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'budget_transaction_journal', 'budget_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -2,19 +2,33 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class BudgetLimit
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class BudgetLimit extends Model
|
class BudgetLimit extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function budget()
|
public function budget()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\Budget');
|
return $this->belongsTo('FireflyIII\Models\Budget');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'startdate'];
|
return ['created_at', 'updated_at', 'startdate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function limitrepetitions()
|
public function limitrepetitions()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\LimitRepetition');
|
return $this->hasMany('FireflyIII\Models\LimitRepetition');
|
||||||
|
@@ -3,20 +3,34 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Category
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Category extends Model
|
class Category extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
return $this->belongsToMany('FireflyIII\Models\TransactionJournal', 'category_transaction_journal', 'category_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -3,10 +3,18 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Component
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Component extends Model
|
class Component extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
|
@@ -2,14 +2,25 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class LimitRepetition
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class LimitRepetition extends Model
|
class LimitRepetition extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function budgetLimit()
|
public function budgetLimit()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||||
|
@@ -3,30 +3,50 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PiggyBank
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class PiggyBank extends Model
|
class PiggyBank extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function account()
|
public function account()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\Account');
|
return $this->belongsTo('FireflyIII\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
return ['created_at', 'updated_at', 'deleted_at', 'startdate', 'targetdate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function piggyBankEvents()
|
public function piggyBankEvents()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function piggyBankRepetitions()
|
public function piggyBankRepetitions()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
|
return $this->hasMany('FireflyIII\Models\PiggyBankRepetition');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
|
*/
|
||||||
public function reminders()
|
public function reminders()
|
||||||
{
|
{
|
||||||
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
|
return $this->morphMany('FireflyIII\Models\Reminder', 'remindersable');
|
||||||
|
@@ -2,19 +2,33 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PiggyBankEvent
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class PiggyBankEvent extends Model
|
class PiggyBankEvent extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'date'];
|
return ['created_at', 'updated_at', 'date'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function piggyBank()
|
public function piggyBank()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function transactionJournal()
|
public function transactionJournal()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||||
|
@@ -2,14 +2,25 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PiggyBankRepetition
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class PiggyBankRepetition extends Model
|
class PiggyBankRepetition extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'startdate', 'targetdate'];
|
return ['created_at', 'updated_at', 'startdate', 'targetdate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function piggyBank()
|
public function piggyBank()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
return $this->belongsTo('FireflyIII\Models\PiggyBank');
|
||||||
|
@@ -2,26 +2,45 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Preference
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Preference extends Model
|
class Preference extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $fillable = ['user_id', 'data', 'name'];
|
protected $fillable = ['user_id', 'data', 'name'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function getDataAttribute($value)
|
public function getDataAttribute($value)
|
||||||
{
|
{
|
||||||
return json_decode($value);
|
return json_decode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at'];
|
return ['created_at', 'updated_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*/
|
||||||
public function setDataAttribute($value)
|
public function setDataAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['data'] = json_encode($value);
|
$this->attributes['data'] = json_encode($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -2,19 +2,33 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Reminder
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Reminder extends Model
|
class Reminder extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||||
|
*/
|
||||||
public function remindersable()
|
public function remindersable()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -4,6 +4,11 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Transaction
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class Transaction extends Model
|
class Transaction extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount'];
|
protected $fillable = ['account_id', 'transaction_journal_id', 'description', 'amount'];
|
||||||
@@ -16,16 +21,25 @@ class Transaction extends Model
|
|||||||
];
|
];
|
||||||
use SoftDeletes, ValidatingTrait;
|
use SoftDeletes, ValidatingTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function account()
|
public function account()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\Account');
|
return $this->belongsTo('FireflyIII\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function transactionJournal()
|
public function transactionJournal()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
return $this->belongsTo('FireflyIII\Models\TransactionJournal');
|
||||||
|
@@ -3,15 +3,26 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TransactionCurrency
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class TransactionCurrency extends Model
|
class TransactionCurrency extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function transactionJournals()
|
public function transactionJournals()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||||
|
@@ -3,20 +3,34 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TransactionGroup
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class TransactionGroup extends Model
|
class TransactionGroup extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
|
return $this->belongsToMany('FireflyIII\Models\TransactionJournal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -30,26 +30,43 @@ class TransactionJournal extends Model
|
|||||||
'encrypted' => 'required|boolean'
|
'encrypted' => 'required|boolean'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function bill()
|
public function bill()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\Bill');
|
return $this->belongsTo('FireflyIII\Models\Bill');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
public function budgets()
|
public function budgets()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('FireflyIII\Models\Budget');
|
return $this->belongsToMany('FireflyIII\Models\Budget');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
public function categories()
|
public function categories()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('FireflyIII\Models\Category');
|
return $this->belongsToMany('FireflyIII\Models\Category');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'date', 'deleted_at'];
|
return ['created_at', 'updated_at', 'date', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function getDescriptionAttribute($value)
|
public function getDescriptionAttribute($value)
|
||||||
{
|
{
|
||||||
if ($this->encrypted) {
|
if ($this->encrypted) {
|
||||||
@@ -61,6 +78,9 @@ class TransactionJournal extends Model
|
|||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function piggyBankEvents()
|
public function piggyBankEvents()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
||||||
@@ -119,32 +139,50 @@ class TransactionJournal extends Model
|
|||||||
$query->whereIn('transaction_types.type', $types);
|
$query->whereIn('transaction_types.type', $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*/
|
||||||
public function setDescriptionAttribute($value)
|
public function setDescriptionAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['description'] = \Crypt::encrypt($value);
|
$this->attributes['description'] = \Crypt::encrypt($value);
|
||||||
$this->attributes['encrypted'] = true;
|
$this->attributes['encrypted'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function transactionCurrency()
|
public function transactionCurrency()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\TransactionCurrency');
|
return $this->belongsTo('FireflyIII\Models\TransactionCurrency');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function transactionType()
|
public function transactionType()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\Models\TransactionType');
|
return $this->belongsTo('FireflyIII\Models\TransactionType');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
|
*/
|
||||||
public function transactiongroups()
|
public function transactiongroups()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('FireflyIII\Models\TransactionGroup');
|
return $this->belongsToMany('FireflyIII\Models\TransactionGroup');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function transactions()
|
public function transactions()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Transaction');
|
return $this->hasMany('FireflyIII\Models\Transaction');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('FireflyIII\User');
|
return $this->belongsTo('FireflyIII\User');
|
||||||
|
@@ -2,9 +2,17 @@
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TransactionRelation
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class TransactionRelation extends Model
|
class TransactionRelation extends Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at'];
|
return ['created_at', 'updated_at'];
|
||||||
|
@@ -3,15 +3,26 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class TransactionType
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Models
|
||||||
|
*/
|
||||||
class TransactionType extends Model
|
class TransactionType extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
{
|
{
|
||||||
return ['created_at', 'updated_at', 'deleted_at'];
|
return ['created_at', 'updated_at', 'deleted_at'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function transactionJournals()
|
public function transactionJournals()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||||
|
@@ -2,33 +2,39 @@
|
|||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider {
|
/**
|
||||||
|
* Class AppServiceProvider
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Providers
|
||||||
|
*/
|
||||||
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap any application services.
|
* Bootstrap any application services.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register any application services.
|
* Register any application services.
|
||||||
*
|
*
|
||||||
* This service provider is a great spot to register your various container
|
* This service provider is a great spot to register your various container
|
||||||
* bindings with the application. As you can see, we are registering our
|
* bindings with the application. As you can see, we are registering our
|
||||||
* "Registrar" implementation here. You can add your own bindings too!
|
* "Registrar" implementation here. You can add your own bindings too!
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'Illuminate\Contracts\Auth\Registrar',
|
'Illuminate\Contracts\Auth\Registrar',
|
||||||
'FireflyIII\Services\Registrar'
|
'FireflyIII\Services\Registrar'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,32 +3,40 @@
|
|||||||
use Illuminate\Bus\Dispatcher;
|
use Illuminate\Bus\Dispatcher;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class BusServiceProvider extends ServiceProvider {
|
/**
|
||||||
|
* Class BusServiceProvider
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Providers
|
||||||
|
*/
|
||||||
|
class BusServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bootstrap any application services.
|
* Bootstrap any application services.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Bus\Dispatcher $dispatcher
|
* @param \Illuminate\Bus\Dispatcher $dispatcher
|
||||||
* @return void
|
*
|
||||||
*/
|
* @return void
|
||||||
public function boot(Dispatcher $dispatcher)
|
*/
|
||||||
{
|
public function boot(Dispatcher $dispatcher)
|
||||||
$dispatcher->mapUsing(function($command)
|
{
|
||||||
{
|
$dispatcher->mapUsing(
|
||||||
return Dispatcher::simpleMapping(
|
function ($command) {
|
||||||
$command, 'FireflyIII\Commands', 'FireflyIII\Handlers\Commands'
|
return Dispatcher::simpleMapping(
|
||||||
);
|
$command, 'FireflyIII\Commands', 'FireflyIII\Handlers\Commands'
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register any application services.
|
* Register any application services.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,22 +2,30 @@
|
|||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class ConfigServiceProvider extends ServiceProvider {
|
/**
|
||||||
|
* Class ConfigServiceProvider
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Providers
|
||||||
|
*/
|
||||||
|
class ConfigServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overwrite any vendor / package configuration.
|
* Overwrite any vendor / package configuration.
|
||||||
*
|
*
|
||||||
* This service provider is intended to provide a convenient location for you
|
* This service provider is intended to provide a convenient location for you
|
||||||
* to overwrite any "vendor" or package configuration that you may want to
|
* to overwrite any "vendor" or package configuration that you may want to
|
||||||
* modify before the application handles the incoming request / command.
|
* modify before the application handles the incoming request / command.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
config([
|
config(
|
||||||
//
|
[
|
||||||
]);
|
//
|
||||||
}
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,30 +3,38 @@
|
|||||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
class EventServiceProvider extends ServiceProvider {
|
/**
|
||||||
|
* Class EventServiceProvider
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Providers
|
||||||
|
*/
|
||||||
|
class EventServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event handler mappings for the application.
|
* The event handler mappings for the application.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $listen = [
|
protected $listen
|
||||||
'event.name' => [
|
= [
|
||||||
'EventListener',
|
'event.name' => [
|
||||||
],
|
'EventListener',
|
||||||
];
|
],
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register any other events for your application.
|
* Register any other events for your application.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Contracts\Events\Dispatcher $events
|
* @param \Illuminate\Contracts\Events\Dispatcher $events
|
||||||
* @return void
|
*
|
||||||
*/
|
* @return void
|
||||||
public function boot(DispatcherContract $events)
|
*/
|
||||||
{
|
public function boot(DispatcherContract $events)
|
||||||
parent::boot($events);
|
{
|
||||||
|
parent::boot($events);
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,14 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Providers;
|
namespace FireflyIII\Providers;
|
||||||
|
|
||||||
|
use FireflyIII\Support\Amount;
|
||||||
|
use FireflyIII\Support\ExpandedForm;
|
||||||
|
use FireflyIII\Support\Navigation;
|
||||||
|
use FireflyIII\Support\Preferences;
|
||||||
|
use FireflyIII\Support\Steam;
|
||||||
|
use FireflyIII\Validation\FireflyValidator;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Validator;
|
use Validator;
|
||||||
use FireflyIII\Validation\FireflyValidator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FireflyServiceProvider
|
* Class FireflyServiceProvider
|
||||||
@@ -13,38 +18,41 @@ use FireflyIII\Validation\FireflyValidator;
|
|||||||
*/
|
*/
|
||||||
class FireflyServiceProvider extends ServiceProvider
|
class FireflyServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
public function boot() {
|
public function boot()
|
||||||
Validator::resolver(function($translator, $data, $rules, $messages)
|
{
|
||||||
{
|
Validator::resolver(
|
||||||
return new FireflyValidator($translator, $data, $rules, $messages);
|
function ($translator, $data, $rules, $messages) {
|
||||||
});
|
return new FireflyValidator($translator, $data, $rules, $messages);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'preferences', function () {
|
'preferences', function () {
|
||||||
return new \FireflyIII\Support\Preferences;
|
return new Preferences;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'navigation', function () {
|
'navigation', function () {
|
||||||
return new \FireflyIII\Support\Navigation;
|
return new Navigation;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'amount', function () {
|
'amount', function () {
|
||||||
return new \FireflyIII\Support\Amount;
|
return new Amount;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'steam', function () {
|
'steam', function () {
|
||||||
return new \FireflyIII\Support\Steam;
|
return new Steam;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
'expandedform', function () {
|
'expandedform', function () {
|
||||||
return new \FireflyIII\Support\ExpandedForm;
|
return new ExpandedForm;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -4,6 +4,11 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvi
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Routing\Router;
|
use Illuminate\Routing\Router;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class RouteServiceProvider
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Providers
|
||||||
|
*/
|
||||||
class RouteServiceProvider extends ServiceProvider
|
class RouteServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -40,7 +45,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
//Steam::removeEmptyBudgetLimits();
|
//Steam::removeEmptyBudgetLimits();
|
||||||
//$reminders = Reminders::getReminders();
|
//$reminders = Reminders::getReminders();
|
||||||
}
|
}
|
||||||
// View::share('reminders', $reminders);
|
// View::share('reminders', $reminders);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -56,6 +61,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
$router->group(
|
$router->group(
|
||||||
['namespace' => $this->namespace], function ($router) {
|
['namespace' => $this->namespace], function ($router) {
|
||||||
|
/** @noinspection PhpIncludeInspection */
|
||||||
require app_path('Http/routes.php');
|
require app_path('Http/routes.php');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -75,6 +75,8 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
* @param Account $account
|
* @param Account $account
|
||||||
* @param Account $opposing
|
* @param Account $opposing
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
*
|
||||||
|
* @return TransactionJournal
|
||||||
*/
|
*/
|
||||||
protected function _storeInitialBalance(Account $account, Account $opposing, array $data)
|
protected function _storeInitialBalance(Account $account, Account $opposing, array $data)
|
||||||
{
|
{
|
||||||
|
@@ -3,7 +3,17 @@
|
|||||||
namespace FireflyIII\Repositories\Account;
|
namespace FireflyIII\Repositories\Account;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface AccountRepositoryInterface
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Repositories\Account
|
||||||
|
*/
|
||||||
interface AccountRepositoryInterface
|
interface AccountRepositoryInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @param array $data
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
public function store(array $data);
|
public function store(array $data);
|
||||||
}
|
}
|
@@ -2,7 +2,12 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Repositories\Journal;
|
namespace FireflyIII\Repositories\Journal;
|
||||||
|
|
||||||
|
/**
|
||||||
class JournalRepository implements JournalRepositoryInterface {
|
* Class JournalRepository
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Repositories\Journal
|
||||||
|
*/
|
||||||
|
class JournalRepository implements JournalRepositoryInterface
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
@@ -9,6 +9,12 @@
|
|||||||
namespace FireflyIII\Repositories\Journal;
|
namespace FireflyIII\Repositories\Journal;
|
||||||
|
|
||||||
|
|
||||||
interface JournalRepositoryInterface {
|
/**
|
||||||
|
* Interface JournalRepositoryInterface
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Repositories\Journal
|
||||||
|
*/
|
||||||
|
interface JournalRepositoryInterface
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
@@ -4,6 +4,11 @@ use FireflyIII\User;
|
|||||||
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
|
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
|
||||||
use Validator;
|
use Validator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Registrar
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Services
|
||||||
|
*/
|
||||||
class Registrar implements RegistrarContract
|
class Registrar implements RegistrarContract
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -35,9 +40,9 @@ class Registrar implements RegistrarContract
|
|||||||
{
|
{
|
||||||
return Validator::make(
|
return Validator::make(
|
||||||
$data, [
|
$data, [
|
||||||
'email' => 'required|email|max:255|unique:users',
|
'email' => 'required|email|max:255|unique:users',
|
||||||
'password' => 'required|confirmed|min:6',
|
'password' => 'required|confirmed|min:6',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,8 +30,8 @@ class Amount
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \Transaction $transaction
|
* @param Transaction|\Transaction $transaction
|
||||||
* @param bool $coloured
|
* @param bool $coloured
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@@ -181,6 +181,14 @@ class ExpandedForm
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @param array $list
|
||||||
|
* @param null $selected
|
||||||
|
* @param array $options
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
public function select($name, array $list = [], $selected = null, array $options = [])
|
public function select($name, array $list = [], $selected = null, array $options = [])
|
||||||
{
|
{
|
||||||
$label = $this->label($name, $options);
|
$label = $this->label($name, $options);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace FireflyIII\Support\Facades;
|
namespace FireflyIII\Support\Facades;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Amount
|
* Class Amount
|
||||||
*
|
*
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace FireflyIII\Support\Facades;
|
namespace FireflyIII\Support\Facades;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Amount
|
* Class Amount
|
||||||
*
|
*
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace FireflyIII\Support\Facades;
|
namespace FireflyIII\Support\Facades;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Navigation
|
* Class Navigation
|
||||||
*
|
*
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace FireflyIII\Support\Facades;
|
namespace FireflyIII\Support\Facades;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Preferences
|
* Class Preferences
|
||||||
*
|
*
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
namespace FireflyIII\Support\Facades;
|
namespace FireflyIII\Support\Facades;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Steam
|
* Class Steam
|
||||||
*
|
*
|
||||||
|
@@ -14,6 +14,13 @@ class Navigation
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $range
|
||||||
|
* @param Carbon $date
|
||||||
|
*
|
||||||
|
* @return Carbon
|
||||||
|
* @throws FireflyException
|
||||||
|
*/
|
||||||
public function jumpToNext($range, Carbon $date)
|
public function jumpToNext($range, Carbon $date)
|
||||||
{
|
{
|
||||||
switch ($range) {
|
switch ($range) {
|
||||||
@@ -47,6 +54,13 @@ class Navigation
|
|||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $range
|
||||||
|
* @param Carbon $date
|
||||||
|
*
|
||||||
|
* @return Carbon
|
||||||
|
* @throws FireflyException
|
||||||
|
*/
|
||||||
public function jumpToPrevious($range, Carbon $date)
|
public function jumpToPrevious($range, Carbon $date)
|
||||||
{
|
{
|
||||||
$functionMap = [
|
$functionMap = [
|
||||||
@@ -80,6 +94,13 @@ class Navigation
|
|||||||
throw new FireflyException('Cannot do _previous() on ' . $range);
|
throw new FireflyException('Cannot do _previous() on ' . $range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $range
|
||||||
|
* @param Carbon $date
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @throws FireflyException
|
||||||
|
*/
|
||||||
public function periodName($range, Carbon $date)
|
public function periodName($range, Carbon $date)
|
||||||
{
|
{
|
||||||
$formatMap = [
|
$formatMap = [
|
||||||
@@ -106,6 +127,13 @@ class Navigation
|
|||||||
throw new FireflyException('No _periodName() for range "' . $range . '"');
|
throw new FireflyException('No _periodName() for range "' . $range . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $range
|
||||||
|
* @param Carbon $start
|
||||||
|
*
|
||||||
|
* @return Carbon
|
||||||
|
* @throws FireflyException
|
||||||
|
*/
|
||||||
public function updateEndDate($range, Carbon $start)
|
public function updateEndDate($range, Carbon $start)
|
||||||
{
|
{
|
||||||
$functionMap = [
|
$functionMap = [
|
||||||
@@ -135,6 +163,13 @@ class Navigation
|
|||||||
throw new FireflyException('updateEndDate cannot handle $range ' . $range);
|
throw new FireflyException('updateEndDate cannot handle $range ' . $range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $range
|
||||||
|
* @param Carbon $start
|
||||||
|
*
|
||||||
|
* @return Carbon
|
||||||
|
* @throws FireflyException
|
||||||
|
*/
|
||||||
public function updateStartDate($range, Carbon $start)
|
public function updateStartDate($range, Carbon $start)
|
||||||
{
|
{
|
||||||
$functionMap = [
|
$functionMap = [
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Support;
|
namespace FireflyIII\Support;
|
||||||
|
|
||||||
use \FireflyIII\Models\Preference;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
|
use FireflyIII\Models\Preference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Preferences
|
* Class Preferences
|
||||||
|
@@ -15,7 +15,7 @@ class Steam
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
|
32
app/User.php
32
app/User.php
@@ -6,6 +6,11 @@ use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
|||||||
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class User
|
||||||
|
*
|
||||||
|
* @package FireflyIII
|
||||||
|
*/
|
||||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
|
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -30,46 +35,73 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||||||
*/
|
*/
|
||||||
protected $table = 'users';
|
protected $table = 'users';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function accounts()
|
public function accounts()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Account');
|
return $this->hasMany('FireflyIII\Models\Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function bills()
|
public function bills()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Bill');
|
return $this->hasMany('FireflyIII\Models\Bill');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function budgets()
|
public function budgets()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Budget');
|
return $this->hasMany('FireflyIII\Models\Budget');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function categories()
|
public function categories()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Category');
|
return $this->hasMany('FireflyIII\Models\Category');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||||
|
*/
|
||||||
public function piggyBanks()
|
public function piggyBanks()
|
||||||
{
|
{
|
||||||
return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'Account');
|
return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'Account');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function preferences()
|
public function preferences()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Preference');
|
return $this->hasMany('FireflyIII\Models\Preference');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function reminders()
|
public function reminders()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\Reminder');
|
return $this->hasMany('FireflyIII\Models\Reminder');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
{
|
{
|
||||||
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
return $this->hasMany('FireflyIII\Models\TransactionJournal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $value
|
||||||
|
*/
|
||||||
public function setPasswordAttribute($value)
|
public function setPasswordAttribute($value)
|
||||||
{
|
{
|
||||||
$this->attributes['password'] = \Hash::make($value);
|
$this->attributes['password'] = \Hash::make($value);
|
||||||
|
@@ -2,18 +2,31 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Validation;
|
namespace FireflyIII\Validation;
|
||||||
|
|
||||||
use Illuminate\Validation\Validator;
|
|
||||||
use DB;
|
use DB;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class FireflyValidator
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Validation
|
||||||
|
*/
|
||||||
class FireflyValidator extends Validator
|
class FireflyValidator extends Validator
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $attribute
|
||||||
|
* @param $value
|
||||||
|
* @param $parameters
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function validateUniqueForUser($attribute, $value, $parameters)
|
public function validateUniqueForUser($attribute, $value, $parameters)
|
||||||
{
|
{
|
||||||
$count = DB::table($parameters[0])->where($parameters[1],$value)->count();
|
$count = DB::table($parameters[0])->where($parameters[1], $value)->count();
|
||||||
if($count == 0) {
|
if ($count == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateUsersTable
|
* Class CreateUsersTable
|
||||||
*/
|
*/
|
||||||
class CreateUsersTable extends Migration
|
class CreateUsersTable extends Migration
|
||||||
@@ -30,13 +30,13 @@ class CreateUsersTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'users', function (Blueprint $table) {
|
'users', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->string('email', 100)->unique();
|
$table->string('email', 100)->unique();
|
||||||
$table->string('password', 60);
|
$table->string('password', 60);
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
$table->string('reset', 32)->nullable();
|
$table->string('reset', 32)->nullable();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateAccountTypesTable
|
* Class CreateAccountTypesTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,13 +31,13 @@ class CreateAccountTypesTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'account_types', function (Blueprint $table) {
|
'account_types', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->string('type', 30);
|
$table->string('type', 30);
|
||||||
$table->boolean('editable');
|
$table->boolean('editable');
|
||||||
|
|
||||||
$table->unique('type');
|
$table->unique('type');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateAccountsTable
|
* Class CreateAccountsTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,23 +31,23 @@ class CreateAccountsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'accounts', function (Blueprint $table) {
|
'accounts', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->integer('account_type_id')->unsigned();
|
$table->integer('account_type_id')->unsigned();
|
||||||
$table->string('name', 100);
|
$table->string('name', 100);
|
||||||
$table->boolean('active');
|
$table->boolean('active');
|
||||||
|
|
||||||
// connect accounts to users
|
// connect accounts to users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
// connect accounts to account_types
|
// connect accounts to account_types
|
||||||
$table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
|
$table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
|
||||||
|
|
||||||
// for a user, the account name must be unique.
|
// for a user, the account name must be unique.
|
||||||
$table->unique(['user_id', 'account_type_id', 'name']);
|
$table->unique(['user_id', 'account_type_id', 'name']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateComponentsTable
|
* Class CreateComponentsTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,19 +31,19 @@ class CreateComponentsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'components', function (Blueprint $table) {
|
'components', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->string('name', 50);
|
$table->string('name', 50);
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->string('class', 20);
|
$table->string('class', 20);
|
||||||
|
|
||||||
// connect components to users
|
// connect components to users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
// for a user, the component type & name must be unique.
|
// for a user, the component type & name must be unique.
|
||||||
$table->unique(['user_id', 'class', 'name']);
|
$table->unique(['user_id', 'class', 'name']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreatePiggybanksTable
|
* Class CreatePiggybanksTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,29 +31,29 @@ class CreatePiggybanksTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'piggybanks', function (Blueprint $table) {
|
'piggybanks', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('account_id')->unsigned();
|
$table->integer('account_id')->unsigned();
|
||||||
$table->string('name', 100);
|
$table->string('name', 100);
|
||||||
$table->decimal('targetamount', 10, 2);
|
$table->decimal('targetamount', 10, 2);
|
||||||
$table->date('startdate')->nullable();
|
$table->date('startdate')->nullable();
|
||||||
$table->date('targetdate')->nullable();
|
$table->date('targetdate')->nullable();
|
||||||
$table->boolean('repeats');
|
$table->boolean('repeats');
|
||||||
$table->enum('rep_length', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
|
$table->enum('rep_length', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
|
||||||
$table->smallInteger('rep_every')->unsigned();
|
$table->smallInteger('rep_every')->unsigned();
|
||||||
$table->smallInteger('rep_times')->unsigned()->nullable();
|
$table->smallInteger('rep_times')->unsigned()->nullable();
|
||||||
$table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
|
$table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
|
||||||
$table->smallInteger('reminder_skip')->unsigned();
|
$table->smallInteger('reminder_skip')->unsigned();
|
||||||
$table->boolean('remind_me');
|
$table->boolean('remind_me');
|
||||||
$table->integer('order')->unsigned();
|
$table->integer('order')->unsigned();
|
||||||
|
|
||||||
// connect account to piggy bank.
|
// connect account to piggy bank.
|
||||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
|
|
||||||
// for an account, the name must be unique.
|
// for an account, the name must be unique.
|
||||||
$table->unique(['account_id', 'name']);
|
$table->unique(['account_id', 'name']);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateTransactionCurrenciesTable
|
* Class CreateTransactionCurrenciesTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,14 +31,14 @@ class CreateTransactionCurrenciesTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'transaction_currencies', function (Blueprint $table) {
|
'transaction_currencies', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->string('code', 3);
|
$table->string('code', 3);
|
||||||
|
|
||||||
// code must be unique.
|
// code must be unique.
|
||||||
$table->unique(['code']);
|
$table->unique(['code']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateTransactionTypesTable
|
* Class CreateTransactionTypesTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,14 +31,14 @@ class CreateTransactionTypesTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'transaction_types', function (Blueprint $table) {
|
'transaction_types', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->string('type', 50);
|
$table->string('type', 50);
|
||||||
|
|
||||||
// type must be unique.
|
// type must be unique.
|
||||||
$table->unique(['type']);
|
$table->unique(['type']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateRecurringTransactionsTable
|
* Class CreateRecurringTransactionsTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,28 +31,28 @@ class CreateRecurringTransactionsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'recurring_transactions', function (Blueprint $table) {
|
'recurring_transactions', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->string('name', 50);
|
$table->string('name', 50);
|
||||||
$table->string('match', 255);
|
$table->string('match', 255);
|
||||||
$table->decimal('amount_min', 10, 2);
|
$table->decimal('amount_min', 10, 2);
|
||||||
$table->decimal('amount_max', 10, 2);
|
$table->decimal('amount_max', 10, 2);
|
||||||
$table->date('date');
|
$table->date('date');
|
||||||
$table->boolean('active');
|
$table->boolean('active');
|
||||||
|
|
||||||
$table->boolean('automatch');
|
$table->boolean('automatch');
|
||||||
$table->enum('repeat_freq', ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly']);
|
$table->enum('repeat_freq', ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly']);
|
||||||
$table->smallInteger('skip')->unsigned();
|
$table->smallInteger('skip')->unsigned();
|
||||||
|
|
||||||
// connect user id to users
|
// connect user id to users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
// for a user, the name must be unique
|
// for a user, the name must be unique
|
||||||
$table->unique(['user_id', 'name']);
|
$table->unique(['user_id', 'name']);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateTransactionJournalsTable
|
* Class CreateTransactionJournalsTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,31 +31,31 @@ class CreateTransactionJournalsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'transaction_journals', function (Blueprint $table) {
|
'transaction_journals', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->integer('transaction_type_id')->unsigned();
|
$table->integer('transaction_type_id')->unsigned();
|
||||||
$table->integer('recurring_transaction_id')->unsigned()->nullable();
|
$table->integer('recurring_transaction_id')->unsigned()->nullable();
|
||||||
$table->integer('transaction_currency_id')->unsigned();
|
$table->integer('transaction_currency_id')->unsigned();
|
||||||
$table->string('description', 255)->nullable();
|
$table->string('description', 255)->nullable();
|
||||||
$table->boolean('completed');
|
$table->boolean('completed');
|
||||||
$table->date('date');
|
$table->date('date');
|
||||||
|
|
||||||
// connect users
|
// connect users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
// connect transaction journals to transaction types
|
// connect transaction journals to transaction types
|
||||||
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
|
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
|
||||||
|
|
||||||
// connect transaction journals to recurring transactions
|
// connect transaction journals to recurring transactions
|
||||||
$table->foreign('recurring_transaction_id')->references('id')->on('recurring_transactions')->onDelete('set null');
|
$table->foreign('recurring_transaction_id')->references('id')->on('recurring_transactions')->onDelete('set null');
|
||||||
|
|
||||||
// connect transaction journals to transaction currencies
|
// connect transaction journals to transaction currencies
|
||||||
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateTransactionsTable
|
* Class CreateTransactionsTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,29 +31,26 @@ class CreateTransactionsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'transactions', function (Blueprint $table) {
|
'transactions', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->integer('account_id')->unsigned();
|
$table->integer('account_id')->unsigned();
|
||||||
$table->integer('piggybank_id')->nullable()->unsigned();
|
$table->integer('piggybank_id')->nullable()->unsigned();
|
||||||
$table->integer('transaction_journal_id')->unsigned();
|
$table->integer('transaction_journal_id')->unsigned();
|
||||||
$table->string('description', 255)->nullable();
|
$table->string('description', 255)->nullable();
|
||||||
$table->decimal('amount', 10, 2);
|
$table->decimal('amount', 10, 2);
|
||||||
|
|
||||||
// connect account id:
|
// connect account id:
|
||||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
|
|
||||||
// connect piggy banks
|
// connect piggy banks
|
||||||
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null');
|
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('set null');
|
||||||
|
|
||||||
// connect transactions to transaction journals
|
// connect transactions to transaction journals
|
||||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
*
|
*
|
||||||
* Class CreateComponentTransactionTable
|
* Class CreateComponentTransactionTable
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,19 +31,19 @@ class CreateComponentTransactionTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'component_transaction', function (Blueprint $table) {
|
'component_transaction', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('component_id')->unsigned();
|
$table->integer('component_id')->unsigned();
|
||||||
$table->integer('transaction_id')->unsigned();
|
$table->integer('transaction_id')->unsigned();
|
||||||
|
|
||||||
// connect to components
|
// connect to components
|
||||||
$table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
|
$table->foreign('component_id')->references('id')->on('components')->onDelete('cascade');
|
||||||
|
|
||||||
// connect to transactions
|
// connect to transactions
|
||||||
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
|
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
|
||||||
|
|
||||||
// combo must be unique:
|
// combo must be unique:
|
||||||
$table->unique(['component_id', 'transaction_id']);
|
$table->unique(['component_id', 'transaction_id']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,18 +31,18 @@ class CreatePreferencesTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'preferences', function (Blueprint $table) {
|
'preferences', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->text('data');
|
$table->text('data');
|
||||||
|
|
||||||
// connect preferences to users
|
// connect preferences to users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
// only one preference per name per user
|
// only one preference per name per user
|
||||||
$table->unique(['user_id', 'name']);
|
$table->unique(['user_id', 'name']);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,18 +31,18 @@ class CreateLimitRepeatTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'limit_repetitions', function (Blueprint $table) {
|
'limit_repetitions', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('limit_id')->unsigned();
|
$table->integer('limit_id')->unsigned();
|
||||||
$table->date('startdate');
|
$table->date('startdate');
|
||||||
$table->date('enddate');
|
$table->date('enddate');
|
||||||
$table->decimal('amount', 10, 2);
|
$table->decimal('amount', 10, 2);
|
||||||
|
|
||||||
$table->unique(['limit_id', 'startdate', 'enddate']);
|
$table->unique(['limit_id', 'startdate', 'enddate']);
|
||||||
|
|
||||||
// connect limit
|
// connect limit
|
||||||
$table->foreign('limit_id')->references('id')->on('limits')->onDelete('cascade');
|
$table->foreign('limit_id')->references('id')->on('limits')->onDelete('cascade');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,18 +31,18 @@ class CreatePiggybankRepetitionsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'piggybank_repetitions', function (Blueprint $table) {
|
'piggybank_repetitions', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('piggybank_id')->unsigned();
|
$table->integer('piggybank_id')->unsigned();
|
||||||
$table->date('startdate')->nullable();
|
$table->date('startdate')->nullable();
|
||||||
$table->date('targetdate')->nullable();
|
$table->date('targetdate')->nullable();
|
||||||
$table->decimal('currentamount', 10, 2);
|
$table->decimal('currentamount', 10, 2);
|
||||||
|
|
||||||
$table->unique(['piggybank_id', 'startdate', 'targetdate']);
|
$table->unique(['piggybank_id', 'startdate', 'targetdate']);
|
||||||
|
|
||||||
// connect instance to piggybank.
|
// connect instance to piggybank.
|
||||||
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
|
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,20 +31,20 @@ class CreatePiggybankEventsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'piggybank_events', function (Blueprint $table) {
|
'piggybank_events', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('piggybank_id')->unsigned();
|
$table->integer('piggybank_id')->unsigned();
|
||||||
$table->integer('transaction_journal_id')->unsigned()->nullable();
|
$table->integer('transaction_journal_id')->unsigned()->nullable();
|
||||||
|
|
||||||
$table->date('date');
|
$table->date('date');
|
||||||
$table->decimal('amount', 10, 2);
|
$table->decimal('amount', 10, 2);
|
||||||
|
|
||||||
// connect instance to piggybank.
|
// connect instance to piggybank.
|
||||||
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
|
$table->foreign('piggybank_id')->references('id')->on('piggybanks')->onDelete('cascade');
|
||||||
|
|
||||||
// connect to journal:
|
// connect to journal:
|
||||||
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
|
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,19 +31,19 @@ class CreateRemindersTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'reminders', function (Blueprint $table) {
|
'reminders', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->date('startdate');
|
$table->date('startdate');
|
||||||
$table->date('enddate')->nullable();
|
$table->date('enddate')->nullable();
|
||||||
$table->boolean('active');
|
$table->boolean('active');
|
||||||
$table->boolean('notnow')->default(0);
|
$table->boolean('notnow')->default(0);
|
||||||
$table->integer('remindersable_id')->unsigned()->nullable();
|
$table->integer('remindersable_id')->unsigned()->nullable();
|
||||||
$table->string('remindersable_type')->nullable();
|
$table->string('remindersable_type')->nullable();
|
||||||
|
|
||||||
// connect reminders to users
|
// connect reminders to users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,33 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
class CreatePasswordResetsTable extends Migration {
|
/**
|
||||||
|
* Class CreatePasswordResetsTable
|
||||||
|
*/
|
||||||
|
class CreatePasswordResetsTable extends Migration
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::create('password_resets', function(Blueprint $table)
|
Schema::drop('password_resets');
|
||||||
{
|
}
|
||||||
$table->string('email')->index();
|
|
||||||
$table->string('token')->index();
|
|
||||||
$table->timestamp('created_at');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::drop('password_resets');
|
Schema::create(
|
||||||
}
|
'password_resets', function (Blueprint $table) {
|
||||||
|
$table->string('email')->index();
|
||||||
|
$table->string('token')->index();
|
||||||
|
$table->timestamp('created_at');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -33,16 +33,16 @@ class CreateAccountMetaTable extends Migration
|
|||||||
//
|
//
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'account_meta', function (Blueprint $table) {
|
'account_meta', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('account_id')->unsigned();
|
$table->integer('account_id')->unsigned();
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->text('data');
|
$table->text('data');
|
||||||
|
|
||||||
$table->unique(['account_id', 'name']);
|
$table->unique(['account_id', 'name']);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,15 +31,15 @@ class CreateTransactionGroupsTable extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'transaction_groups', function (Blueprint $table) {
|
'transaction_groups', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->enum('relation', ['balance']);
|
$table->enum('relation', ['balance']);
|
||||||
|
|
||||||
// connect reminders to users
|
// connect reminders to users
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -32,17 +32,17 @@ class CreateTransactionGroupTransactionJournalTable extends Migration
|
|||||||
|
|
||||||
Schema::create(
|
Schema::create(
|
||||||
'transaction_group_transaction_journal', function (Blueprint $table) {
|
'transaction_group_transaction_journal', function (Blueprint $table) {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('transaction_group_id')->unsigned();
|
$table->integer('transaction_group_id')->unsigned();
|
||||||
$table->integer('transaction_journal_id')->unsigned();
|
$table->integer('transaction_journal_id')->unsigned();
|
||||||
|
|
||||||
// link to foreign tables.
|
// link to foreign tables.
|
||||||
$table->foreign('transaction_group_id', 'tr_grp_id')->references('id')->on('transaction_groups')->onDelete('cascade');
|
$table->foreign('transaction_group_id', 'tr_grp_id')->references('id')->on('transaction_groups')->onDelete('cascade');
|
||||||
$table->foreign('transaction_journal_id', 'tr_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
$table->foreign('transaction_journal_id', 'tr_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
|
||||||
|
|
||||||
// add unique.
|
// add unique.
|
||||||
$table->unique(['transaction_group_id', 'transaction_journal_id'], 'tt_joined');
|
$table->unique(['transaction_group_id', 'transaction_journal_id'], 'tt_joined');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use FireflyIII\Models\BudgetLimit;
|
||||||
|
use FireflyIII\Models\Component;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use FireflyIII\Models\Component;
|
|
||||||
use FireflyIII\Models\BudgetLimit;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
|
* @SuppressWarnings(PHPMD.ShortMethodName) // method names are mandated by laravel.
|
||||||
|
@@ -6,7 +6,6 @@ use Illuminate\Database\Schema\Blueprint;
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||||
* @SuppressWarnings("MethodLength") // I don't mind this in case of migrations.
|
* @SuppressWarnings("MethodLength") // I don't mind this in case of migrations.
|
||||||
|
|
||||||
*
|
*
|
||||||
* Class ChangesForV322
|
* Class ChangesForV322
|
||||||
*/
|
*/
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\QueryException;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccountTypeSeeder
|
* Class AccountTypeSeeder
|
||||||
|
@@ -1,7 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
class DatabaseSeeder extends Seeder {
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class DatabaseSeeder
|
||||||
|
*/
|
||||||
|
class DatabaseSeeder extends Seeder
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the database seeds.
|
* Run the database seeds.
|
||||||
|
@@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use FireflyIII\User;
|
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
use FireflyIII\Models\Budget;
|
|
||||||
use FireflyIII\Models\Bill;
|
use FireflyIII\Models\Bill;
|
||||||
|
use FireflyIII\Models\Budget;
|
||||||
use FireflyIII\Models\BudgetLimit;
|
use FireflyIII\Models\BudgetLimit;
|
||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
use FireflyIII\Models\LimitRepetition;
|
use FireflyIII\Models\LimitRepetition;
|
||||||
use FireflyIII\Models\Reminder;
|
|
||||||
use FireflyIII\Models\PiggyBank;
|
use FireflyIII\Models\PiggyBank;
|
||||||
use FireflyIII\Models\PiggyBankEvent;
|
use FireflyIII\Models\PiggyBankEvent;
|
||||||
use FireflyIII\Models\PiggyBankRepetition;
|
use FireflyIII\Models\PiggyBankRepetition;
|
||||||
|
use FireflyIII\Models\Reminder;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
use FireflyIII\Models\TransactionGroup;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\User;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings("CamelCase") // I'm fine with this.
|
* @SuppressWarnings("CamelCase") // I'm fine with this.
|
||||||
@@ -610,8 +610,8 @@ class TestDataSeeder extends Seeder
|
|||||||
$house = Category::whereName('House')->orderBy('id', 'DESC')->first();
|
$house = Category::whereName('House')->orderBy('id', 'DESC')->first();
|
||||||
$piggyBank = PiggyBank::whereName('New camera')->orderBy('id', 'DESC')->first();
|
$piggyBank = PiggyBank::whereName('New camera')->orderBy('id', 'DESC')->first();
|
||||||
$intoPiggy = $this->createJournal(
|
$intoPiggy = $this->createJournal(
|
||||||
['from' => $checking, 'to' => $savings, 'amount' => 100, 'transactionType' => $transfer, 'description' => 'Money for piggy',
|
['from' => $checking, 'to' => $savings, 'amount' => 100, 'transactionType' => $transfer, 'description' => 'Money for piggy',
|
||||||
'date' => $this->yaeom, 'transactionCurrency' => $euro, 'category' => $house, 'budget' => $groceries]
|
'date' => $this->yaeom, 'transactionCurrency' => $euro, 'category' => $house, 'budget' => $groceries]
|
||||||
);
|
);
|
||||||
PiggyBankEvent::create(
|
PiggyBankEvent::create(
|
||||||
[
|
[
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionCurrencySeeder
|
* Class TransactionCurrencySeeder
|
||||||
*/
|
*/
|
||||||
@@ -11,9 +12,9 @@ class TransactionCurrencySeeder extends Seeder
|
|||||||
{
|
{
|
||||||
DB::table('transaction_currencies')->delete();
|
DB::table('transaction_currencies')->delete();
|
||||||
|
|
||||||
TransactionCurrency::create(['code' => 'EUR','name' => 'Euro','symbol' => '€']);
|
TransactionCurrency::create(['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€']);
|
||||||
TransactionCurrency::create(['code' => 'USD','name' => 'US Dollar','symbol' => '$']);
|
TransactionCurrency::create(['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$']);
|
||||||
TransactionCurrency::create(['code' => 'HUF','name' => 'Hungarian forint','symbol' => 'Ft']);
|
TransactionCurrency::create(['code' => 'HUF', 'name' => 'Hungarian forint', 'symbol' => 'Ft']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionTypeSeeder
|
* Class TransactionTypeSeeder
|
||||||
*/
|
*/
|
||||||
|
@@ -1,17 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ExampleTest extends TestCase {
|
/**
|
||||||
|
* Class ExampleTest
|
||||||
|
*/
|
||||||
|
class ExampleTest extends TestCase
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A basic functional test example.
|
* A basic functional test example.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testBasicExample()
|
public function testBasicExample()
|
||||||
{
|
{
|
||||||
$response = $this->call('GET', '/');
|
$response = $this->call('GET', '/');
|
||||||
|
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,19 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
/**
|
||||||
|
* Class TestCase
|
||||||
|
*/
|
||||||
|
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||||
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the application.
|
* Creates the application.
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Foundation\Application
|
* @return \Illuminate\Foundation\Application
|
||||||
*/
|
*/
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
{
|
{
|
||||||
$app = require __DIR__.'/../bootstrap/app.php';
|
$app = require __DIR__ . '/../bootstrap/app.php';
|
||||||
|
|
||||||
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -155,20 +155,6 @@ class AccountControllerCest
|
|||||||
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
|
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param FunctionalTester $I
|
|
||||||
*/
|
|
||||||
public function storeValidateOnly(FunctionalTester $I)
|
|
||||||
{
|
|
||||||
$I->amOnPage('/accounts/create/asset');
|
|
||||||
$I->wantTo('validate a new asset account');
|
|
||||||
$I->see('Create a new asset account');
|
|
||||||
$I->submitForm(
|
|
||||||
'#store', ['name' => 'New through tests.', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
|
||||||
);
|
|
||||||
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param FunctionalTester $I
|
* @param FunctionalTester $I
|
||||||
*/
|
*/
|
||||||
@@ -197,19 +183,4 @@ class AccountControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param FunctionalTester $I
|
|
||||||
*/
|
|
||||||
public function validateUpdateOnly(FunctionalTester $I)
|
|
||||||
{
|
|
||||||
$I->wantTo('update an asset account and validate only');
|
|
||||||
$I->amOnPage('/accounts/edit/2');
|
|
||||||
$I->see('Edit asset account "Savings account"');
|
|
||||||
$I->submitForm(
|
|
||||||
'#update', ['name' => 'Savings accountXX', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
|
||||||
);
|
|
||||||
$I->dontSeeRecord('accounts', ['name' => 'Savings accountXX']);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use FireflyIII\Models\TransactionJournal;
|
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\Models\TransactionGroup;
|
||||||
|
use FireflyIII\Models\TransactionJournal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @SuppressWarnings("CamelCase")
|
* @SuppressWarnings("CamelCase")
|
||||||
* @SuppressWarnings("short")
|
* @SuppressWarnings("short")
|
||||||
@@ -27,6 +28,9 @@ class RelatedControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function alreadyRelated(FunctionalTester $I)
|
public function alreadyRelated(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$group = TransactionGroup::first();
|
$group = TransactionGroup::first();
|
||||||
@@ -38,6 +42,9 @@ class RelatedControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function alreadyRelatedNoRelations(FunctionalTester $I)
|
public function alreadyRelatedNoRelations(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$journal = TransactionJournal::first();
|
$journal = TransactionJournal::first();
|
||||||
@@ -48,6 +55,9 @@ class RelatedControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function relate(FunctionalTester $I)
|
public function relate(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$journal = TransactionJournal::leftJoin(
|
$journal = TransactionJournal::leftJoin(
|
||||||
@@ -67,6 +77,9 @@ class RelatedControllerCest
|
|||||||
$I->see('true');
|
$I->see('true');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function related(FunctionalTester $I)
|
public function related(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$group = TransactionGroup::first();
|
$group = TransactionGroup::first();
|
||||||
@@ -77,6 +90,9 @@ class RelatedControllerCest
|
|||||||
$I->see('Big expense in ');
|
$I->see('Big expense in ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function removeRelation(FunctionalTester $I)
|
public function removeRelation(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$group = TransactionGroup::first();
|
$group = TransactionGroup::first();
|
||||||
@@ -88,6 +104,9 @@ class RelatedControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function search(FunctionalTester $I)
|
public function search(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$one = TransactionJournal::first();//$group = TransactionGroup::first();
|
$one = TransactionJournal::first();//$group = TransactionGroup::first();
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
use FireflyIII\Models\Reminder;
|
use FireflyIII\Models\Reminder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ReminderControllerCest
|
* Class ReminderControllerCest
|
||||||
*
|
*
|
||||||
@@ -29,7 +30,7 @@ class ReminderControllerCest
|
|||||||
*/
|
*/
|
||||||
public function act(FunctionalTester $I)
|
public function act(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder','!=','')->first(
|
$reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder', '!=', '')->first(
|
||||||
['reminders.*']
|
['reminders.*']
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -73,12 +74,12 @@ class ReminderControllerCest
|
|||||||
*/
|
*/
|
||||||
public function show(FunctionalTester $I)
|
public function show(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder','!=','')->first(
|
$reminder = Reminder::leftJoin('piggy_banks', 'piggy_banks.id', '=', 'reminders.remindersable_id')->where('piggy_banks.reminder', '!=', '')->first(
|
||||||
['reminders.*']
|
['reminders.*']
|
||||||
);
|
);
|
||||||
|
|
||||||
$I->wantTo('see a reminder');
|
$I->wantTo('see a reminder');
|
||||||
$I->amOnPage('/reminders/'.$reminder->id);
|
$I->amOnPage('/reminders/' . $reminder->id);
|
||||||
$I->see('A reminder about');
|
$I->see('A reminder about');
|
||||||
$I->see('your piggy bank labelled "Nieuwe spullen"');
|
$I->see('your piggy bank labelled "Nieuwe spullen"');
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,9 @@ class ReportControllerCest
|
|||||||
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function budget(FunctionalTester $I)
|
public function budget(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see a budget report');
|
$I->wantTo('see a budget report');
|
||||||
@@ -31,6 +34,9 @@ class ReportControllerCest
|
|||||||
$I->see('Budget report for September 2014');
|
$I->see('Budget report for September 2014');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function budgetInvalidDate(FunctionalTester $I)
|
public function budgetInvalidDate(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see a budget report for an invalid date');
|
$I->wantTo('see a budget report for an invalid date');
|
||||||
@@ -38,6 +44,9 @@ class ReportControllerCest
|
|||||||
$I->see('Invalid date');
|
$I->see('Invalid date');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function index(FunctionalTester $I)
|
public function index(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see all possible reports');
|
$I->wantTo('see all possible reports');
|
||||||
@@ -47,6 +56,9 @@ class ReportControllerCest
|
|||||||
$I->see('Budget reports');
|
$I->see('Budget reports');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function month(FunctionalTester $I)
|
public function month(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see a monthly report');
|
$I->wantTo('see a monthly report');
|
||||||
@@ -54,6 +66,9 @@ class ReportControllerCest
|
|||||||
$I->see('Report for September 2014');
|
$I->see('Report for September 2014');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function monthInvalidDate(FunctionalTester $I)
|
public function monthInvalidDate(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see a monthly report for an invalid month');
|
$I->wantTo('see a monthly report for an invalid month');
|
||||||
@@ -61,6 +76,9 @@ class ReportControllerCest
|
|||||||
$I->see('Invalid date');
|
$I->see('Invalid date');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function year(FunctionalTester $I)
|
public function year(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see a yearly report');
|
$I->wantTo('see a yearly report');
|
||||||
@@ -69,6 +87,9 @@ class ReportControllerCest
|
|||||||
$I->see('Account balance');
|
$I->see('Account balance');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function yearInvalidDate(FunctionalTester $I)
|
public function yearInvalidDate(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see a yearly report for an invalid year');
|
$I->wantTo('see a yearly report for an invalid year');
|
||||||
|
@@ -20,6 +20,9 @@ class SearchControllerCest
|
|||||||
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function index(FunctionalTester $I)
|
public function index(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('search for "salary"');
|
$I->wantTo('search for "salary"');
|
||||||
@@ -29,6 +32,9 @@ class SearchControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function indexNoQuery(FunctionalTester $I)
|
public function indexNoQuery(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('Search for empty string');
|
$I->wantTo('Search for empty string');
|
||||||
|
@@ -23,6 +23,9 @@ class TransactionControllerCest
|
|||||||
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function create(FunctionalTester $I)
|
public function create(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('create a transaction');
|
$I->wantTo('create a transaction');
|
||||||
@@ -30,6 +33,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Add a new withdrawal');
|
$I->see('Add a new withdrawal');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function deleteWithdrawal(FunctionalTester $I)
|
public function deleteWithdrawal(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -42,6 +48,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Delete withdrawal "' . $journal->description . '"');
|
$I->see('Delete withdrawal "' . $journal->description . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function destroyDeposit(FunctionalTester $I)
|
public function destroyDeposit(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -56,6 +65,9 @@ class TransactionControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function destroyTransfer(FunctionalTester $I)
|
public function destroyTransfer(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -72,6 +84,9 @@ class TransactionControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function destroyTransferWithEvent(FunctionalTester $I)
|
public function destroyTransferWithEvent(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -87,6 +102,9 @@ class TransactionControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function destroyWithdrawal(FunctionalTester $I)
|
public function destroyWithdrawal(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -102,6 +120,9 @@ class TransactionControllerCest
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function edit(FunctionalTester $I)
|
public function edit(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -115,6 +136,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Edit transfer "' . $journal->description . '"');
|
$I->see('Edit transfer "' . $journal->description . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function index(FunctionalTester $I)
|
public function index(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see all withdrawals');
|
$I->wantTo('see all withdrawals');
|
||||||
@@ -122,6 +146,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Expenses');
|
$I->see('Expenses');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function indexExpenses(FunctionalTester $I)
|
public function indexExpenses(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see all expenses');
|
$I->wantTo('see all expenses');
|
||||||
@@ -129,6 +156,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Revenue, income and deposits');
|
$I->see('Revenue, income and deposits');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function indexTransfers(FunctionalTester $I)
|
public function indexTransfers(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('see all transfers');
|
$I->wantTo('see all transfers');
|
||||||
@@ -136,6 +166,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Transfers');
|
$I->see('Transfers');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function show(FunctionalTester $I)
|
public function show(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -168,6 +201,9 @@ class TransactionControllerCest
|
|||||||
$I->see($journal->description);
|
$I->see($journal->description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function store(FunctionalTester $I)
|
public function store(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('store a transaction');
|
$I->wantTo('store a transaction');
|
||||||
@@ -188,6 +224,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Transaction "Test" stored.');
|
$I->see('Transaction "Test" stored.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function storeAndFail(FunctionalTester $I)
|
public function storeAndFail(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('store a transaction and fail');
|
$I->wantTo('store a transaction and fail');
|
||||||
@@ -208,6 +247,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Could not store transaction: The description field is required.');
|
$I->see('Could not store transaction: The description field is required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function storeAndReturn(FunctionalTester $I)
|
public function storeAndReturn(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('store a transaction');
|
$I->wantTo('store a transaction');
|
||||||
@@ -228,6 +270,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Transaction "Test" stored.');
|
$I->see('Transaction "Test" stored.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function storeValidate(FunctionalTester $I)
|
public function storeValidate(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
$I->wantTo('validate a transaction');
|
$I->wantTo('validate a transaction');
|
||||||
@@ -250,6 +295,9 @@ class TransactionControllerCest
|
|||||||
$I->dontSeeRecord('transaction_journals', ['description' => 'TestValidateMe']);
|
$I->dontSeeRecord('transaction_journals', ['description' => 'TestValidateMe']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function update(FunctionalTester $I)
|
public function update(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -276,6 +324,9 @@ class TransactionControllerCest
|
|||||||
$I->see($journal->description . '!');
|
$I->see($journal->description . '!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function updateAndFail(FunctionalTester $I)
|
public function updateAndFail(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -302,6 +353,9 @@ class TransactionControllerCest
|
|||||||
$I->see('Could not update transaction: The description field is required.');
|
$I->see('Could not update transaction: The description field is required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function updateAndReturn(FunctionalTester $I)
|
public function updateAndReturn(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
@@ -327,6 +381,9 @@ class TransactionControllerCest
|
|||||||
$I->see($journal->description . '!');
|
$I->see($journal->description . '!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param FunctionalTester $I
|
||||||
|
*/
|
||||||
public function updateValidate(FunctionalTester $I)
|
public function updateValidate(FunctionalTester $I)
|
||||||
{
|
{
|
||||||
// get withdrawal transaction type id:
|
// get withdrawal transaction type id:
|
||||||
|
Reference in New Issue
Block a user