* 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>
		
			
				
	
	
		
			23 lines
		
	
	
		
			601 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			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."));
 | |
|     }
 | |
| }
 |