you won't find many here willing to help with that forms library
Aug 31, 2022
19
Level 1
Store function won't work
Hello. I have a form what is working well on localhost but on server don't access the store function from Controller.
Form:
{!! Form::open(['method' => 'POST', 'action' => 'HomePageController@store', 'class' => 'appointment-form']) !!}
...
<div class="pull-right">
{!! Form::submit('Submit', ['class' => 'btn btn-default pull-right']) !!}
</div>
{!! Form::close() !!}
Controller:
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$input = $request->all();
dd($input);
if (Auth::check()) {
...
if (env('MAIL_USERNAME') == '' && env('MAIL_PASSWORD') == '') {
return back()->with('added', 'Sikeresn rögzitettük az időpont foglalást!');
}
$data = array(
'name' => $user_name,
'email' => $user_email,
'washing_plan' => $washing_plan,
'vehicle_company' => $vehicle_company,
'vehicle_modal' => $vehicle_modal,
'vehicle_type' => $vehicle_type,
'date' => $appointment_date,
'time_frame' => $time_frame,
);
Mail::send('emails.home_appointment_emails', compact('data'), function ($message) use ($data) {
$message->from(env('MAIL_USERNAME'));
$message->to($data['email']);
$message->subject('Időpont foglalás');
});
Mail::send('emails.home_appointment_emails', compact('data'), function ($message) use ($data) {
$message->to(env('MAIL_USERNAME'));
$message->subject('Új időpont foglalás');
});
return back()->with('added', 'Sikeresn rögzitettük az időpont foglalást!');
}
}
Route:
Route::resource('/', 'HomePageController');
Auth::routes();
After submition the form will don"t store the information on database but is refreshing the page. The interesting thing is that I still have a another form on this website that is working properly.
Please or to participate in this conversation.