public function createOfWorkitems($projectId, $workId)
 {
     $project = \App\Entities\Project::findOrFail($projectId);
     $work = \App\Entities\ProjectWork::findOrFail($workId);
     $units = \App\Entities\Unit::all();
     $costTypes = \App\Entities\CostType::all();
     return view('project-workitems.create', compact('project', 'work', 'units', 'costTypes'));
 }
Пример #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $units = Unit::all();
     return response()->json(compact('units'));
 }
Пример #3
0
 private function seedUnits()
 {
     foreach ($this->units as $unit) {
         Unit::create(['name' => $unit]);
     }
 }