/** * Store the Developers Profile Information. * * @return RedirectResponse */ public function store(DeveloperRequest $request) { $developer = new Developer(); $developer->name = $request->input('name'); $developer->url = $request->input('url'); $developer->bio = $request->input('description'); $developer->email = $request->input('email'); $developer->work_place = $request->input('work_place'); $developer->code_name = $request->input('codename'); $developer->tags = $request->input('tags'); $developer->save(); /* * Email Notification immediately Developer Profile is submitted */ $this->mailer->submitProfile(); $developer_msg = "Naija Developer's Details Successfully Submitted, Approval happens within 24hrs"; $request->session()->flash('approval-status', $developer_msg); return view('developers.create'); }
/** * Approve developer profiles submitted by the Users. * @param Integer $id * @return RedirectResponse */ public function devapprove($id) { $developers = Developer::find($id); $email = $developers->email; $codeName = strtoupper($developers->code_name); $developers->approval_status = 1; $developers->save(); /* * Send email to the User on Profile Approval */ $this->devmailer->notifyDevOfApproval($email, $data = [], $codeName); $message = "Developer " . $developers->name . " has been Approved Successfully"; return Redirect::to('admin/developers/')->withMessage($message); }