本文整理汇总了PHP中StudentInfo::find方法的典型用法代码示例。如果您正苦于以下问题:PHP StudentInfo::find方法的具体用法?PHP StudentInfo::find怎么用?PHP StudentInfo::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StudentInfo
的用法示例。
在下文中一共展示了StudentInfo::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postApply
public function postApply()
{
$data = Input::all();
$user = Sentry::getUser();
$student = StudentInfo::find($user->id);
$job = Job::findOrFail($data["job_id"]);
$errors = new \Illuminate\Support\MessageBag();
if (!$job->isOpen()) {
$errors->add("job_not_open", "not open");
}
if (!$job->VerfiyCertificates($student)) {
$errors->add("student_certificates", "does not have necessary certificates");
}
if ($student->isGraduate()) {
$errors->add("student_graduated", "Student graduated");
}
if ($job->isAwarded() > 0) {
$errors->add("student_applied", "already Applied");
}
if ($errors->count() > 0) {
return Redirect::back()->withErrors($errors);
}
$jobApplication = JobApplicant::create(array("job_id" => $job->id, "user_id" => $user->id, "job_applicant_status_id" => JobApplicantStatus::$APPLIED));
$jobApplication->LogStatus($user->id);
$employer = $job->employer;
$applicant = $jobApplication->studentInfo;
Mail::send('emails.jobs.new_applicant', compact('applicant', 'job'), function ($message) use($employer, $job) {
$message->from('mail@quadjobs.com', 'QuadJobs');
$message->to($employer->email, $employer->first_name . ' ' . $employer->last_name);
$message->subject("There's a new student interested in your job posting");
});
return Redirect::action("JobApplicantsController@anyThankYou");
}