public function addJob(Request $request) { $alchemyapi = new AlchemyAPI("f167c81454212e29113812f93b6f0efc9bb6842e"); $user = Auth::User(); $job = new Jobs(); if ($user && Auth::check()) { $job->employer_id = $user->id; $job->title = $request->input('title'); $job->description = $request->input('description'); $job->venue = $request->input('venue'); $job->amount = $request->input('amount'); $job->company = $request->input('company'); $job->save(); $files = []; try { $files = $request->file("images"); foreach ($files as $file) { $imageName = $job->id . "." . $file->getClientOriginalExtension(); $file->move(base_path() . '/public/images/job/', $imageName); $jobImage = new JobsImages(); $jobImage->job_id = $job->id; $jobImage->src = $imageName; $jobImage->save(); $response = $alchemyapi->keywords('text', $job->description, array('sentiment' => 1)); if (isset($response['keywords'])) { foreach ($response['keywords'] as $key) { $jobKey = new JobKeywords(); $jobKey->job_id = $job->id; $jobKey->keyword = $key['text']; $jobKey->score = $key['relevance']; $jobKey->sentiment = $key['sentiment']['type']; $jobKey->save(); } } } } catch (\Exception $e) { } $API_KEY = "8a2318b0-d121-11e5-8378-4dad29be0fab"; $BASE_PATH = "http://api.cortical.io/rest"; $RETINA_NAME = "en_associative"; $apiClient = new APIClient($API_KEY, $BASE_PATH); $textApi = new TextApi($apiClient); $keywords = $textApi->getKeywordsForText($job->description, "en_associative"); if ($keywords && isset($keywords) && count($keywords) > 1) { foreach ($keywords as $key) { $jobKey = new JobKeywords(); $jobKey->job_id = $job->id; $jobKey->keyword = $key; $jobKey->score = ""; $jobKey->sentiment = ""; $jobKey->save(); } } Session::flash('success', 'Job added successfully.'); return view("pages.newJob"); } }
public function run() { DB::table('jobs')->delete(); Jobs::insert([['category_id' => 1, 'type_id' => 1, 'user_id' => 1, 'company_name' => 'Burlington, MA', 'title' => 'Senior Graphic Designer', 'description' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus risus at dapibus malesuada. Vestibulum euismod, velit sit amet tempor ornare, nulla augue mattis mi, nec ultricies dolor augue nec lectus. Integer bibendum enim ipsum, at eleifend nisl elementum sit amet. Etiam eget magna et nunc ultrices suscipit. Duis a ligula vel nisi auctor laoreet. Morbi varius suscipit purus, sed pretium nisl sagittis id. Aliquam vel nulla tempor, luctus quam nec, egestas sem. Nulla nulla ante, faucibus fringilla blandit non, porttitor at eros.</p> <p>Cras luctus cursus pretium. Fusce rhoncus tortor at lectus dignissim, sed dignissim enim euismod. Pellentesque venenatis lacus diam. Nulla aliquam turpis vel lorem viverra consequat. Curabitur vitae vehicula lacus. Fusce quis imperdiet tortor. Fusce enim massa, tincidunt vel lobortis non, mattis quis turpis. Nam lobortis, lectus vitae iaculis bibendum, felis nulla consectetur leo, nec volutpat orci elit ut lorem. Nunc sagittis mauris quis tellus ullamcorper facilisis. Sed volutpat lacus in gravida condimentum. Maecenas sit amet massa vel neque suscipit porta. In luctus odio ante, a scelerisque tellus imperdiet id. Nunc in mollis lectus. Nam lobortis dui lorem, nec lacinia erat pellentesque non. In mattis eget massa sit amet elementum.</p>', 'city' => 'Tanger', 'state' => 'active', 'contact_email' => '*****@*****.**'], ['category_id' => 1, 'type_id' => 1, 'user_id' => 1, 'company_name' => 'UX Designer', 'title' => 'UX Designer', 'description' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus risus at dapibus malesuada. Vestibulum euismod, velit sit amet tempor ornare, nulla augue mattis mi, nec ultricies dolor augue nec lectus. Integer bibendum enim ipsum, at eleifend nisl elementum sit amet. Etiam eget magna et nunc ultrices suscipit. Duis a ligula vel nisi auctor laoreet. Morbi varius suscipit purus, sed pretium nisl sagittis id. Aliquam vel nulla tempor, luctus quam nec, egestas sem. Nulla nulla ante, faucibus fringilla blandit non, porttitor at eros.</p> <p>Cras luctus cursus pretium. Fusce rhoncus tortor at lectus dignissim, sed dignissim enim euismod. Pellentesque venenatis lacus diam. Nulla aliquam turpis vel lorem viverra consequat. Curabitur vitae vehicula lacus. Fusce quis imperdiet tortor. Fusce enim massa, tincidunt vel lobortis non, mattis quis turpis. Nam lobortis, lectus vitae iaculis bibendum, felis nulla consectetur leo, nec volutpat orci elit ut lorem. Nunc sagittis mauris quis tellus ullamcorper facilisis. Sed volutpat lacus in gravida condimentum. Maecenas sit amet massa vel neque suscipit porta. In luctus odio ante, a scelerisque tellus imperdiet id. Nunc in mollis lectus. Nam lobortis dui lorem, nec lacinia erat pellentesque non. In mattis eget massa sit amet elementum.</p>', 'city' => 'Tanger', 'state' => 'active', 'contact_email' => '*****@*****.**'], ['category_id' => 1, 'type_id' => 1, 'user_id' => 1, 'company_name' => 'Registered Nurse', 'title' => 'Registered Nurse', 'description' => '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse dapibus risus at dapibus malesuada. Vestibulum euismod, velit sit amet tempor ornare, nulla augue mattis mi, nec ultricies dolor augue nec lectus. Integer bibendum enim ipsum, at eleifend nisl elementum sit amet. Etiam eget magna et nunc ultrices suscipit. Duis a ligula vel nisi auctor laoreet. Morbi varius suscipit purus, sed pretium nisl sagittis id. Aliquam vel nulla tempor, luctus quam nec, egestas sem. Nulla nulla ante, faucibus fringilla blandit non, porttitor at eros.</p> <p>Cras luctus cursus pretium. Fusce rhoncus tortor at lectus dignissim, sed dignissim enim euismod. Pellentesque venenatis lacus diam. Nulla aliquam turpis vel lorem viverra consequat. Curabitur vitae vehicula lacus. Fusce quis imperdiet tortor. Fusce enim massa, tincidunt vel lobortis non, mattis quis turpis. Nam lobortis, lectus vitae iaculis bibendum, felis nulla consectetur leo, nec volutpat orci elit ut lorem. Nunc sagittis mauris quis tellus ullamcorper facilisis. Sed volutpat lacus in gravida condimentum. Maecenas sit amet massa vel neque suscipit porta. In luctus odio ante, a scelerisque tellus imperdiet id. Nunc in mollis lectus. Nam lobortis dui lorem, nec lacinia erat pellentesque non. In mattis eget massa sit amet elementum.</p>', 'city' => 'Tanger', 'state' => 'active', 'contact_email' => '*****@*****.**']]); }
public function searchJob(Request $request) { if (Auth::check()) { $searchValue = $request->input('searchValue'); $jobs = Jobs::join('job_keywords', 'jobs.id', '=', 'job_keywords.job_id')->where('title', 'LIKE', "%{$searchValue}%")->orWhere('keyword', 'LIKE', "%{$searchValue}%")->select("jobs.*")->groupBy('jobs.id')->get(); return view('pages.userJobSearch', array("jobs" => $jobs)); } else { return view('pages.home'); } }
public function handle($command) { //dd($command); Jobs::post($command->title, $command->description); var_dump('Sending a text message'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { // Jobs::destroy($id); return redirect()->route('jobs.index'); }
public function postAdd(AddJobRequest $request) { // Jobs::create($request->all()); return redirect('jobs/add')->with('success', 'Вакансия успешно добалена!'); }