app/Http/Controllers/NoteController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $note = Note::create([
            'user_id' => Auth::id(),
            'text' => $request->text
        ]);
        return new NoteResource($note);
    }
public function store ( Request $ request ) { $ note = Note :: create ( [ 'user_id' => Auth :: id ( ) , 'text' => $ request -> text ] ) ; return new NoteResource ( $ note ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .