Пример #1
0
 /**
  * Remove the job.
  *
  * @param Model   $job
  *
  * @return Response
  */
 public function destroy(JobAdminRequest $request, Job $job)
 {
     try {
         $t = $job->delete();
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('career::job.name')]), 'code' => 202, 'redirect' => trans_url('/admin/career/job/0')], 202);
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 400, 'redirect' => trans_url('/admin/career/job/' . $job->getRouteKey())], 400);
     }
 }
Пример #2
0
 /**
  * Remove the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy(JobUserRequest $request, Job $job)
 {
     try {
         $this->repository->delete($job->getRouteKey());
         return response()->json(['message' => trans('messages.success.deleted', ['Module' => trans('career::job.name')]), 'code' => 202, 'redirect' => trans_url('/user/career/job')], 202);
     } catch (Exception $e) {
         redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);
     }
 }
Пример #3
0
 /**
  * Remove the job.
  *
  * @param Request $request
  * @param Model   $job
  *
  * @return json
  */
 public function destroy(JobUserApiRequest $request, Job $job)
 {
     try {
         $t = $job->delete();
         return response()->json(['message' => trans('messages.success.delete', ['Module' => trans('career::job.name')]), 'code' => 2006])->setStatusCode(202, 'DESTROY_SUCCESS');
     } catch (Exception $e) {
         return response()->json(['message' => $e->getMessage(), 'code' => 4006])->setStatusCode(400, 'DESTROY_ERROR');
     }
 }
Пример #4
0
 public function transform(\Litecms\Career\Models\Job $job)
 {
     return ['id' => $job->getRouteKey(), 'title' => ucfirst($job->title), 'published' => $job->published, 'image' => $job->image, 'job_type' => ucfirst($job->job_type), 'location' => ucfirst($job->location), 'details' => ucfirst($job->details), 'published' => $job->published == 'Yes' ? 'Published' : '-'];
 }