Esempio n. 1
0
 /**
  * Store the Projects Information.
  *
  * @return RedirectResponse
  */
 public function store(ProjectRequest $request)
 {
     $project = new Project();
     $project->name = $request->input('title');
     $project->url = $request->input('url');
     $project->description = $request->input('description');
     $project->categories = $request->input('categories')[0];
     $project->email = $request->input('from');
     $project->tags = $request->input('tags')[0];
     $project->approval_status = $request->input('approval_status');
     $project->save();
     /*
      * Email Notification immediately Project is submitted
      */
     $this->mailer->submitProject();
     $success_msg = "Project Successfully Submitted, Approval happens within 24 hours";
     $request->session()->flash('approval-status', $success_msg);
     return view('projects.create');
 }
Esempio n. 2
0
 /**
  * Approve projects submitted by the Users.
  *
  * @return Response
  */
 public function approve($id)
 {
     $projects = Project::find($id);
     $email = $projects->email;
     $projectTitle = strtoupper($projects->name);
     $projects->approval_status = 1;
     $projects->save();
     /*
      * Send email to the User on Project Approval
      */
     $this->promailer->notifyUserOfApproval($email, $data = [], $projectTitle);
     $message = "Project " . $projects->name . " has been Approved Successfully";
     return Redirect::to('admin/projects/')->withMessage($message);
 }