request->add([ 'secret' => bin2hex(random_bytes(16)), 'status' => 'new', 'type' => 'AGENCY' ]); $company = Company::create($request->only('name', 'email', 'inn', 'legal_address', 'secret', 'status', 'type')); if ($company) { $companyConfirmByBitrix = new SendCompany($company); $companyConfirmByBitrix->send(); return view('company.created'); } else { return back()->withInputs(); } } }