Answer the question
In order to leave comments, you need to log in
Why can't I process data from a form in laravel?
Here is a piece of the template:
<form action="admin_suc" method="get">
@foreach($admin as $administrator)
<strong>{{$administrator->name}} {{$administrator->surname}}</strong> просит разрешения стать риэлтором<br>
<a href="admin_suc?id={{$administrator->id}}"><button type="button" class="btn btn-success" name="success">Подтвердить </button></a>
<a href="admin_suc?id={{$administrator->id}}"><button type="button" class="btn btn-danger" name="cancel">Отклонить</button><br></a>
@endforeach
</form>
Route::any('admin_suc','[email protected]');
public function get()
{
$request = new Request();
if ($request->input('success')){
Admin::confirmation_realtor($id=2,$confirmation_realtor=2,$id_role=3);
echo 1;
}
else if ($request->input('cancel')){
Admin::confirmation_realtor($id,$confirmation_realtor=0,$id_role=2);
echo 2;
}
}
Answer the question
In order to leave comments, you need to log in
laravel.com/docs/5.1/requests#accessing-the-request
In the template, you have some kind of horror going on - a form, inside of which are buttons, inside of which are links, and all this with relative addresses.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question