public function create()
 {
     $user = Auth::user();
     $disassemblers = Disassembler::lists('name', 'id');
     $types = ProjectType::lists('type', 'id');
     return view('projects.create', compact('disassemblers', 'types', 'user'));
 }
 public function run()
 {
     DB::table('disassemblers')->delete();
     $collection = [['name' => 'Tupelo Regional Airport (KTUP)', 'short_name' => 'Tupelo, MS', 'address' => '118 Lemons Drive', 'city' => 'Tupelo', 'state' => 'MS', 'postal_code' => '38801', 'contact' => 'Dean Lowry', 'phone' => '6626209434', 'email' => '*****@*****.**'], ['name' => 'On-site', 'short_name' => 'On-site']];
     foreach ($collection as $record) {
         Disassembler::create($record);
     }
 }
 public function update($id)
 {
     // save updated
     $record = $this->records->find($id);
     if (!$record) {
         Disassembler::create(Input::all());
         return $this->respond($record);
     }
     $record->fill(Input::all())->save();
     return $this->respond($record);
 }
Example #4
0
 public function profile($id = null)
 {
     $adc = ConsortiumGlobal::where('id', '1')->first();
     $atas = Ata::where('active', 1)->get();
     $disassemblers = Disassembler::lists('name', 'id');
     $user = Auth::user();
     $types = ProjectType::lists('type', 'id');
     $company = Company::where('id', $user->company_id)->first();
     if ($id) {
         $project = Project::find($id);
     } else {
         $project = Project::create(['creator_id' => $user->id, 'company_id' => $user->company_id, 'directory_path' => $company->company . '/' . date('Y') . '/']);
     }
     return view('projects.profile', compact('adc', 'atas', 'company', 'disassemblers', 'project', 'types', 'user'));
 }