Marimokung
Marimokung

Reputation: 123

laravel : cannot get input from textarea by function store in controller

In donation.blade.php

<form method="post" action="store"> 
     Donor: <input type="text" name="Donor" class="form-control" placeholder="donor" /> 
     Delivered Date: <input type="date" name="Date_donate" class="form-control" />
     Artist: <input type="text" name="Artist" class="form-control" placeholder="artist" /> 
     Title: <input type="text" name="Title" class="form-control" placeholder="title" /> 
     Year: <input type="text" name="Year" class="form-control" placeholder="year" /> 
     Origin: <input type="text" name="Origin" class="form-control" placeholder="origin" /> 
     Epoch: <input type="text" name="Epoch" class="form-control" placeholder="epoch" /> 
     Desciption: <textarea name="Desciption" class="form-control" rows="5" placeholder="description"></textarea>
     <label> Choose file for upload: </label><br>
     <input type="file" name="select_image" />
     <span class="text-muted">jpg, png, gif</span><br><br>

     <input type="hidden" name="_token" value="{{ csrf_token() }}">

     <input type="submit" class="btn btn-primary" name="submit" value="Submit" /> <br><br>
</form>

In Art_objController

    public function store(Request $request)
    {
        $art_objs = new Art_obj(
            ['Artist' => $request->get('Artist'),
            'Year' => $request->get('Year'),
            'Title' => $request->get('Title'),
            'Description' => $request->input('description'),
            'Origin' => $request->get('Origin'),
            'Epoch' => $request->get('Epoch'),
        ]);
        $art_objs->save();
        return redirect()->back();
    }

I try to use $request->get but it not work then I try to use $request->input it also not work. Please Help me.

Upvotes: 0

Views: 1195

Answers (1)

Shailendra Gupta
Shailendra Gupta

Reputation: 1118

you have to get it like

$request->Desciption

Upvotes: 1

Related Questions