snipe-it/app/Http/Controllers/SavedReportsController.php

21 lines
496 B
PHP
Raw Normal View History

2023-08-28 16:26:31 -07:00
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SavedReportsController extends Controller
{
public function store(Request $request)
{
$this->authorize('reports.view');
2023-12-11 14:19:03 -08:00
$report = $request->user()->savedReports()->create([
'name' => $request->get('report_name'),
'options' => $request->except(['_token', 'report_name']),
]);
2023-12-11 14:19:03 -08:00
return redirect()->route('reports/custom', ['report' => $report->id]);
2023-08-28 16:26:31 -07:00
}
}