Files
firefly-iii/app/Http/Controllers/CategoryController.php

66 lines
1.7 KiB
PHP
Raw Normal View History

2016-05-20 08:57:45 +02:00
<?php
/**
* CategoryController.php
2017-10-21 08:40:00 +02:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
2017-10-21 08:40:00 +02:00
* This file is part of Firefly III.
*
2017-10-21 08:40:00 +02: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 14:41:58 +01:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
2017-04-08 09:00:37 +02:00
declare(strict_types=1);
2016-05-20 08:57:45 +02:00
namespace FireflyIII\Http\Controllers;
2015-02-22 16:19:32 +01:00
use FireflyIII\Http\Requests\CategoryFormRequest;
use FireflyIII\Models\Category;
2016-12-27 10:46:11 +01:00
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
2016-12-28 13:02:56 +01:00
use Illuminate\Http\Request;
2017-12-28 09:53:21 +01:00
use Illuminate\Pagination\LengthAwarePaginator;
2015-09-25 16:00:14 +02:00
use Illuminate\Support\Collection;
2015-02-22 16:19:32 +01:00
/**
2017-11-15 12:25:49 +01:00
* Class CategoryController.
2015-02-22 16:19:32 +01:00
*/
class CategoryController extends Controller
{
2018-07-21 08:06:24 +02:00
/** @var CategoryRepositoryInterface The category repository */
2018-01-14 19:36:24 +01:00
private $repository;
2015-02-24 22:53:38 +01:00
/**
2018-07-08 12:08:53 +02:00
* CategoryController constructor.
2015-02-24 22:53:38 +01:00
*/
2015-02-22 16:19:32 +01:00
public function __construct()
{
2015-04-28 15:26:30 +02:00
parent::__construct();
2016-10-29 07:44:46 +02:00
$this->middleware(
function ($request, $next) {
2018-07-15 09:38:49 +02:00
app('view')->share('title', (string)trans('firefly.categories'));
2017-12-16 19:46:36 +01:00
app('view')->share('mainTitleIcon', 'fa-bar-chart');
2018-07-14 22:48:22 +02:00
$this->repository = app(CategoryRepositoryInterface::class);
2016-10-29 07:44:46 +02:00
return $next($request);
}
);
2015-02-22 16:19:32 +01:00
}
2015-03-29 21:27:51 +02:00
2015-02-22 16:19:32 +01:00
2018-07-08 12:08:53 +02:00
2015-02-22 16:19:32 +01:00
2018-07-08 12:08:53 +02:00
2015-02-22 16:19:32 +01:00
}