public function store(Request $request, CompanyRepository $repository)
    {
        $data = $request->validate([
            'name' => 'required',
            'email' => 'required|email',
            'message' => 'required'
        ]);

        $company = $repository->default();

        Mail::to($company->email)->send(new SendContactEmail($company, $data));

        return redirect()
            ->route('contact')
            ->with('message', trans('company.contact.message'));
    }
public function store(Request $request, CompanyRepository $repository)
    {
        $data = $request->validate([
            'name' => 'required',
            'email' => 'required|email',
            'message' => 'required'
        ]);

        $company = $repository->default();

        Mail::to($company->email)->send(new SendContactEmail($company, $data));

        return redirect()
            ->route('contact')
            ->with('message', trans('company.contact.message'));
    }
public function store ( Request $ request , CompanyRepository $ repository ) { $ data = $ request -> validate ( [ 'name' => 'required' , 'email' => 'required|email' , 'message' => 'required' ] ) ; $ company = $ repository -> default ( ) ; Mail :: to ( $ company -> email ) -> send ( new SendContactEmail ( $ company , $ data ) ) ; return redirect ( ) -> route ( 'contact' ) -> with ( 'message' , trans ( 'company.contact.message' ) ) ; }
Sends the contact us email.

@param  Request $request
@param  CompanyRepository $repository

@return void
Sends the contact us email .