Files
firefly-iii/app/Http/Controllers/Admin/HomeController.php

62 lines
1.9 KiB
PHP
Raw Normal View History

2016-04-03 07:07:17 +02:00
<?php
/**
* HomeController.php
2017-10-21 08:40:00 +02:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
2016-04-03 07:07:17 +02:00
*
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
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
2016-04-03 07:07:17 +02:00
*/
declare(strict_types=1);
2016-04-03 07:07:17 +02:00
namespace FireflyIII\Http\Controllers\Admin;
2017-09-27 15:45:55 +02:00
use FireflyIII\Events\AdminRequestedTestMessage;
2016-04-03 07:07:17 +02:00
use FireflyIII\Http\Controllers\Controller;
2017-09-27 15:45:55 +02:00
use Illuminate\Http\Request;
use Log;
2017-10-05 11:49:06 +02:00
use Session;
2016-04-03 07:07:17 +02:00
/**
2017-11-15 12:25:49 +01:00
* Class HomeController.
2016-04-03 07:07:17 +02:00
*/
class HomeController extends Controller
{
/**
2016-11-26 10:39:05 +01:00
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
2016-04-03 07:07:17 +02:00
*/
public function index()
{
$title = strval(trans('firefly.administration'));
$mainTitleIcon = 'fa-hand-spock-o';
return view('admin.index', compact('title', 'mainTitleIcon'));
}
2017-09-27 15:45:55 +02:00
/**
* @param Request $request
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function testMessage(Request $request)
{
$ipAddress = $request->ip();
Log::debug(sprintf('Now in testMessage() controller. IP is %s', $ipAddress));
event(new AdminRequestedTestMessage(auth()->user(), $ipAddress));
Session::flash('info', strval(trans('firefly.send_test_triggered')));
2017-10-05 11:49:06 +02:00
2017-09-27 15:45:55 +02:00
return redirect(route('admin.index'));
}
2016-04-08 17:54:25 +02:00
}