toby/app/Infrastructure/Http/Controllers/SelectYearPeriodController.php
Ewelina Lasowy f81c7ca8fa
#42 - global notifications (#50)
* change layout

* change layout

* #22 - wip

* wip

* wip

* #22 - wip

* #22 - wip

* #22 - wip

* #22 - wip

* #22 - fix

* #22 - wip

* #22 - added some tests

* #22 - wip

* #22 - wip

* #22 - fix

* #42 - wip

* #42 - wip

* #42 - fix

* #42 - wip

Co-authored-by: Adrian Hopek <adrian.hopek@blumilk.pl>
2022-02-16 08:43:12 +01:00

23 lines
601 B
PHP

<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Controllers;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Toby\Eloquent\Helpers\YearPeriodRetriever;
use Toby\Eloquent\Models\YearPeriod;
class SelectYearPeriodController extends Controller
{
public function __invoke(Request $request, YearPeriod $yearPeriod): RedirectResponse
{
$request->session()->put(YearPeriodRetriever::SESSION_KEY, $yearPeriod->id);
return redirect()
->back()
->with("success", __("Selected year period has been changed."));
}
}