/** * Run the database seeds. * * @return void */ public function run() { DB::table('eras'); $era = new Era(); $era->name = "Pre-war"; $era->save(); $era = new Era(); $era->name = "1940s-1950s"; $era->save(); $era = new Era(); $era->name = "1960s-1980s"; $era->save(); $era = new Era(); $era->name = "1980s-Present"; $era->save(); }
public function create() { $artists = ['default' => 'Choose an artist'] + Artist::orderby('name', 'ASC')->lists('name', 'id')->all(); $eras = ['default' => 'Choose an era'] + Era::lists('name', 'id')->all(); $categories = ['default' => 'Choose a category'] + Category::orderby('name', 'ASC')->lists('name', 'id')->all(); $colors = ['default' => 'Choose a color'] + Color::orderby('colorEnglish', 'ASC')->lists('colorEnglish', 'id')->all(); $styles = ['default' => 'Choose a style'] + Style::orderby('name', 'ASC')->lists('name', 'id')->all(); $newestAuction = Auction::where('FK_status_id', '=', 1)->orWhere('FK_status_id', '=', 3)->orderBy('created_at', 'desc')->first(); $timenow = Carbon::now()->addDays(1)->toDateString(); //de datum nu return View::make('create')->with('artists', $artists)->with('eras', $eras)->with('categories', $categories)->with('colors', $colors)->with('styles', $styles)->with('newestAuction', $newestAuction)->with('timenow', $timenow); }
public function newArt() { $getEra = Era::all(); foreach ($getEra as $Era) { $eras[$Era->id] = $Era->name; } $getStyle = Style::all(); foreach ($getStyle as $Style) { $styles[$Style->id] = $Style->name; } $getCountry = Country::all(); foreach ($getCountry as $Country) { $countrys[$Country->name] = $Country->name; } return view('art.new', compact('styles', 'eras', 'countrys')); }
public function getPath($filter, $value) { $path = $filter . " > "; switch ($filter) { case 'style': $path .= Style::where('id', $value)->select('name')->first()->name; break; case 'era': $path .= Era::where('id', $value)->select('name')->first()->name; break; case 'price': $path .= $this->filterOnPrice($value) . "-" . $value; break; case 'when': break; } return $path; }