app/Http/Controllers/PageController.php
/* Handle callback form
     *
     * @return \Illuminate\Http\Response
     */
Handle callback form
@return \Illuminate\Http\Response
Handle callback form @return \ Illuminate \ Http \ Response
public function callback(Request $request)
    {
        $data = $request->validate([
            'name' => 'required|max:255|string',
            'phone_number' => 'required|max:255|regex:/^(\+7[0-9\(\)-]{13})$/',
        ], [], [
            'name' => __('messages.first_name'),
            'phone_number' => __('messages.phone_number'),
        ]);
        tap(new Callback($data))->save();
        $request->session()->flash('callback_success', __('messages.callback_save'));
        return redirect('/contacts');
    }
public function callback ( Request $ request ) { $ data = $ request -> validate ( [ 'name' => 'required|max:255|string' , 'phone_number' => 'required|max:255|regex:/^(\+7[0-9\(\)-]{13})$/' , ] , [ ] , [ 'name' => __ ( 'messages.first_name' ) , 'phone_number' => __ ( 'messages.phone_number' ) , ] ) ; tap ( new Callback ( $ data ) ) -> save ( ) ; $ request -> session ( ) -> flash ( 'callback_success' , __ ( 'messages.callback_save' ) ) ; return redirect ( '/contacts' ) ; }
Handle callback form
 @return \Illuminate\Http\Response
Handle callback form @return \ Illuminate \ Http \ Response