Exemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit(User $user)
 {
     if ($user) {
         $president = HumanResource::president();
         $positions = Position::all();
         $departments = Department::department()->get();
         $institutes = Department::institute()->get();
         return view('user.api.edit')->with(compact('user', 'president', 'positions', 'departments', 'institutes'));
     } else {
         return false;
     }
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $departments = Department::department()->get();
     $institutes = Department::institute()->get();
     $positions = Position::all();
     return view('employee.index')->with(compact('departments', 'institutes', 'positions'));
 }
Exemplo n.º 3
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $position = Position::create($request->all());
     return response()->json($position, 201);
 }
Exemplo n.º 4
0
 public function show($id)
 {
     $position = Position::findOrFail($id);
     return response()->view('positions.show', compact('position'));
 }