public function actionDelete($id) { $user = Auth::user(); $label = Label::where('user_id', '=', $user->id)->findOrFail($id); $label->delete($label); \Session::flash('flash_message', 'You have successfully deleted a label.'); return redirect('labels'); }
public static function unlabeled() { $label = Label::where('label', 'unlabeled')->get()->first(); if ($label == null) { $label = new Label(); $label->label = 'unlabeled'; $label->save(); } return $label; }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function create() { $rankings = Ranking::where('rankable_type', '=', 'App\\Brochure')->get(); $labels = Label::where('status', '=', '1')->where('type', '=', 'Brochure')->orderBy('name', 'ASC')->get(); foreach ($labels as $label) { $brochures[$label['name']] = Brochure::where('status', '=', '1')->where('label_id', '=', $label['id'])->orderBy('name', 'ASC')->lists('name', 'id'); } if (count($rankings)) { return view('brochurerankings.create', compact('brochures', 'rankings')); } return view('brochurerankings.create', compact('brochures')); }
/** * Detach label from photo. * * @return Response */ public function detach() { $label = Label::where('name', Input::get('label'))->firstOrFail(); $items = $this->splitFilesAndFolders(); if (count($items['files'])) { $label->files()->detach($items['files']); } if (count($items['folders'])) { $label->folders()->detach($items['folders']); } return response()->json(trans('app.' . Input::get('label') . 'DetachSuccess')); }
public function viewUpdate($id) { $user = Auth::user(); $movie = Movie::where('user_id', '=', $user->id)->findOrFail($id); $genres = Genre::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get(); $ratings = Rating::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get(); $directors = Director::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get(); $writers = Writer::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get(); $casts = Cast::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get(); $labels = Label::where('user_id', '=', $user->id)->orderBy('name', 'asc')->get(); return view('movies.viewUpdate')->with('movie', $movie)->with('genres', $genres)->with('ratings', $ratings)->with('directors', $directors)->with('writers', $writers)->with('casts', $casts)->with('labels', $labels); }
/** * Run the database seeds. * * @return void */ public function run() { $muse = new Artist(['name' => 'Muse', 'origin' => 'Teignmouth, Devon, England', 'activeFrom' => Carbon::create(1994), 'activeTo' => null, 'source' => 'wikipedia']); $muse->save(); $muse->labels()->attach([Label::where(['name' => 'Warner Bros.'])->first()->id, Label::where(['name' => 'Helium 3'])->first()->id, Label::where(['name' => 'Taste'])->first()->id, Label::where(['name' => 'Mushroom'])->first()->id, Label::where(['name' => 'East West'])->first()->id, Label::where(['name' => 'Dangerous'])->first()->id]); $radiohead = new Artist(['name' => 'Radiohead', 'origin' => 'Abingdon, Oxfordshire, England', 'activeFrom' => Carbon::create(1985), 'activeTo' => null, 'source' => 'wikipedia']); $radiohead->save(); $radiohead->labels()->attach([Label::where(['name' => 'XL'])->first()->id, Label::where(['name' => 'Ticker Tape Ltd.'])->first()->id, Label::where(['name' => 'Hostess'])->first()->id, Label::where(['name' => 'TBD'])->first()->id, Label::where(['name' => 'Parlophone'])->first()->id, Label::where(['name' => 'Capitol'])->first()->id]); $a7x = new Artist(['name' => 'Avenged Sevenfold', 'origin' => 'Huntington Beach, California, U.S.', 'activeFrom' => Carbon::create(1999), 'activeTo' => null, 'source' => 'wikipedia']); $a7x->save(); $a7x->labels()->attach([Label::where(['name' => 'Warner Bros.'])->first()->id, Label::where(['name' => 'Hopeless'])->first()->id, Label::where(['name' => 'Good Life'])->first()->id]); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function create() { $rankings = Ranking::where('rankable_type', '=', 'App\\Image')->get(); $labels = Label::where('status', '=', '1')->where('type', '=', 'Image')->orderBy('name', 'ASC')->get(); foreach ($labels as $label) { $images[$label['name']] = Image::where('status', '=', '1')->where('product', '=', 0)->where('label_id', '=', $label['id'])->orderBy('name', 'ASC')->lists('name', 'id'); } if (count($rankings)) { return view('galleryrankings.create', compact('images', 'rankings')); } return view('galleryrankings.create', compact('images')); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function edit($id) { $colour = Colour::find($id); $labels = Label::where('status', '=', '1')->where('type', '=', 'Colour')->orderBy('name', 'ASC')->lists('name', 'id'); return view('colours.edit', compact('colour', 'labels')); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function edit($id) { $brochure = Brochure::find($id); $labels = Label::where('status', '=', '1')->where('type', '=', 'Brochure')->orderBy('name', 'ASC')->lists('name', 'id'); return view('brochures.edit', compact('brochure', 'labels')); }
/** * Show the form for creating a new Cruiseline. * * @return View */ public function edit($id) { $image = Image::find($id); $labels = Label::where('status', '=', '1')->where('type', '=', 'Image')->orderBy('name', 'ASC')->lists('name', 'id'); return view('galleries.edit', compact('image', 'labels')); }
/** * Display a listing of all Brands. * * @return View */ public function index() { $labels = Label::where('type', '=', 'Image')->get(); return view('imagelabels.index', compact('labels')); }
/** * Display a listing of all Brands. * * @return View */ public function index() { $labels = Label::where('type', '=', 'Colour')->get(); return view('colourlabels.index', compact('labels')); }
private function updateTodoList() { foreach ($this->todos as $todo) { $cr_todo = Todo::where('todoist_id', $todo->id)->first(); if (!$cr_todo) { $cr_todo = new todo(); } if (isset($todo->id)) { $cr_todo->todoist_id = $todo->id; } if (isset($todo->user_id)) { $cr_todo->user_id = $todo->user_id; } if (isset($todo->content)) { $cr_todo->content = $todo->content; } if (isset($todo->due_date)) { $cr_todo->due_date = $todo->due_date; } if (isset($todo->day_order)) { $cr_todo->day_order = $todo->day_order; } if (isset($todo->assigned_by_uid)) { $cr_todo->assigned_by_uid = $todo->assigned_by_uid; } if (isset($todo->sync_id)) { $cr_todo->sync_id = $todo->sync_id; } if (isset($todo->in_history)) { $cr_todo->in_history = $todo->in_history; } if (isset($todo->date_added)) { $cr_todo->date_added = $todo->date_added; } if (isset($todo->checked)) { $cr_todo->checked = $todo->checked; } if (isset($todo->date_lang)) { $cr_todo->date_lang = $todo->date_lang; } if (isset($todo->indent)) { $cr_todo->indent = $todo->indent; } if (isset($todo->is_deleted)) { $cr_todo->is_deleted = $todo->is_deleted; } if (isset($todo->priority)) { $cr_todo->priority = $todo->priority; } if (isset($todo->responsible_uid)) { $cr_todo->responsible_uid = $todo->responsible_uid; } if (isset($todo->project_id)) { $cr_todo->project_id = $todo->project_id; } if (isset($todo->collapsed)) { $cr_todo->collapsed = $todo->collapsed; } //$cr_todo->date_string = $todo->date_string ; if (isset($todo->is_archived)) { $cr_todo->is_archived = $todo->is_archived; } if (isset($todo->item_order)) { $cr_todo->item_order = $todo->item_order; } //$cr_todo->due_date_utc = $todo->due_date_utc ; if (isset($todo->date_checked)) { $cr_todo->date_checked = $todo->date_checked; } $cr_todo->touch(); if (isset($cr_todo->is_deleted)) { if (!$cr_todo->is_deleted) { $cr_todo->save(); } else { $cr_todo->delete(); } } if (isset($todo->labels)) { foreach ($todo->labels as $label) { $label = Label::where('todoist_id', $label)->first(); $cr_todo->labels()->attach($label->id); } } } }
public function search($str) { $out = Label::where('name', 'LIKE', $str . '%')->get(['id', 'name']); return $out; }
public function brochures() { $this->data['brochures'] = Brochure::where('status', '=', 1)->get(); $this->data['labels'] = Label::where('status', '=', 1)->where('type', '=', 'Brochure')->get(); $data = $this->data; return view('brochures', $data); }