mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
WIP: begin to store notes
This commit is contained in:
parent
c165e6f400
commit
53c084c6c0
|
@ -2,12 +2,28 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\NoteAdded;
|
||||
use App\Models\Asset;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class NotesController extends Controller
|
||||
{
|
||||
public function store(Request $request)
|
||||
{
|
||||
dd($request->all());
|
||||
// @todo: validation
|
||||
|
||||
$item = Asset::findOrFail($request->input('id'));
|
||||
|
||||
// @todo: authorization
|
||||
|
||||
event(new NoteAdded($item, Auth::user(), $request->input('note')));
|
||||
|
||||
return redirect()
|
||||
// @todo: make dynamic
|
||||
->route('hardware.show', $request->input('id'))
|
||||
->withFragment('history')
|
||||
// @todo: translate
|
||||
->with('success', 'Success!');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue