2016-05-20 01:57:45 -05:00
|
|
|
<?php
|
2016-05-20 05:27:31 -05:00
|
|
|
/**
|
|
|
|
* CategoryController.php
|
2017-10-21 01:40:00 -05:00
|
|
|
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
2016-05-20 05:27:31 -05:00
|
|
|
*
|
2017-10-21 01:40:00 -05:00
|
|
|
* This file is part of Firefly III.
|
2016-10-04 23:52:15 -05:00
|
|
|
*
|
2017-10-21 01:40:00 -05:00
|
|
|
* Firefly III is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Firefly III is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2017-12-17 07:41:58 -06:00
|
|
|
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
2016-05-20 05:27:31 -05:00
|
|
|
*/
|
2017-04-08 02:00:37 -05:00
|
|
|
declare(strict_types=1);
|
2016-05-20 01:57:45 -05:00
|
|
|
|
|
|
|
namespace FireflyIII\Http\Controllers;
|
2015-02-22 09:19:32 -06:00
|
|
|
|
|
|
|
use FireflyIII\Http\Requests\CategoryFormRequest;
|
|
|
|
use FireflyIII\Models\Category;
|
2016-12-27 03:46:11 -06:00
|
|
|
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
2016-12-28 06:02:56 -06:00
|
|
|
use Illuminate\Http\Request;
|
2017-12-28 02:53:21 -06:00
|
|
|
use Illuminate\Pagination\LengthAwarePaginator;
|
2015-09-25 09:00:14 -05:00
|
|
|
use Illuminate\Support\Collection;
|
2015-02-22 09:19:32 -06:00
|
|
|
|
|
|
|
/**
|
2017-11-15 05:25:49 -06:00
|
|
|
* Class CategoryController.
|
2015-02-22 09:19:32 -06:00
|
|
|
*/
|
|
|
|
class CategoryController extends Controller
|
|
|
|
{
|
2018-07-21 01:06:24 -05:00
|
|
|
/** @var CategoryRepositoryInterface The category repository */
|
2018-01-14 12:36:24 -06:00
|
|
|
private $repository;
|
|
|
|
|
2015-02-24 15:53:38 -06:00
|
|
|
/**
|
2018-07-08 05:08:53 -05:00
|
|
|
* CategoryController constructor.
|
2015-02-24 15:53:38 -06:00
|
|
|
*/
|
2015-02-22 09:19:32 -06:00
|
|
|
public function __construct()
|
|
|
|
{
|
2015-04-28 08:26:30 -05:00
|
|
|
parent::__construct();
|
2016-10-29 00:44:46 -05:00
|
|
|
|
|
|
|
$this->middleware(
|
|
|
|
function ($request, $next) {
|
2018-07-15 02:38:49 -05:00
|
|
|
app('view')->share('title', (string)trans('firefly.categories'));
|
2017-12-16 12:46:36 -06:00
|
|
|
app('view')->share('mainTitleIcon', 'fa-bar-chart');
|
2018-07-14 15:48:22 -05:00
|
|
|
$this->repository = app(CategoryRepositoryInterface::class);
|
2016-10-29 00:44:46 -05:00
|
|
|
|
|
|
|
return $next($request);
|
|
|
|
}
|
|
|
|
);
|
2015-02-22 09:19:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-03-29 14:27:51 -05:00
|
|
|
|
2015-02-22 09:19:32 -06:00
|
|
|
|
|
|
|
|
2018-07-08 05:08:53 -05:00
|
|
|
|
2015-02-22 09:19:32 -06:00
|
|
|
|
2018-07-08 05:08:53 -05:00
|
|
|
|
2015-02-22 09:19:32 -06:00
|
|
|
}
|