Beispiel #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('styles');
     $style = new Style();
     $style->name = "Abstract";
     $style->save();
     $style = new Style();
     $style->name = "African";
     $style->save();
     $style = new Style();
     $style->name = "Asian";
     $style->save();
     $style = new Style();
     $style->name = "Cemceptual";
     $style->save();
     $style = new Style();
     $style->name = "Emerging";
     $style->save();
     $style = new Style();
     $style->name = "Figurative";
     $style->save();
     $style = new Style();
     $style->name = "Middle";
     $style->save();
     $style = new Style();
     $style->name = "Mini";
     $style->save();
     $style = new Style();
     $style->name = "Modern";
     $style->save();
     $style = new Style();
     $style->name = "Pop";
     $style->save();
     $style = new Style();
     $style->name = "Urban";
     $style->save();
     $style = new Style();
     $style->name = "Vintage";
     $style->save();
     $style = new Style();
     $style->name = "Design";
     $style->save();
     $style = new Style();
     $style->name = "Paintings";
     $style->save();
     $style = new Style();
     $style->name = "Photographs";
     $style->save();
     $style = new Style();
     $style->name = "Prints";
     $style->save();
     $style = new Style();
     $style->name = "Sculpture";
     $style->save();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $style = new Style();
     $style->name = 'Abstract';
     $style->save();
     $style = new Style();
     $style->name = 'African American';
     $style->save();
     $style = new Style();
     $style->name = 'Asian Contemporary';
     $style->save();
 }
 public function __construct()
 {
     $lang = Session::get('locale');
     if ($lang != null) {
         \App::setLocale($lang);
     }
     // $data = [];
     $styles = Style::all();
     Session::put('footerStyle', $styles);
     // view()->share('footerStyle', $styles);
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $styles = Style::all();
     $styleArray = [];
     $styleArray[0] = 'select a style';
     foreach ($styles as $style) {
         $styleArray[$style->id] = $style->name;
     }
     $data = ['styleArray' => $styleArray];
     return View('Art.create')->with($data);
 }
 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);
 }
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $user = User::create(['first_name' => $data['first_name'], 'last_name' => $data['last_name'], 'email' => $data['email'], 'dob' => $data['dob'], 'gender' => $data['gender'], 'password' => bcrypt($data['password'])]);
     $name = $data['first_name'];
     $email = $data['email'];
     $user_id = $user->id;
     Calendar::create(array('name' => $name, 'color' => '51, 153, 255', 'user_id' => $user_id));
     Todolist::create(array('name' => 'To Do', 'color' => '0, 0, 102', 'user_id' => $user_id));
     Style::create(array('theme_name' => 'default', 'body_backgroundColor' => '218, 173, 134', 'buttons_backgroundColor' => '117, 168, 202', 'buttons_borderColor' => '89, 105, 114', 'navBar_backgroundColor' => '201, 216, 197', 'menuModal_backgroundColor' => '255, 246, 253', 'user_id' => $user_id));
     $emaildata = array('name' => $name);
     Mail::send('emails.welcome', $emaildata, function ($message) use($email) {
         $message->from('*****@*****.**', 'gmPlanner');
         $message->to($email)->subject('Welcome to gmPlanner');
     });
     return $user;
 }
Beispiel #7
0
 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'));
 }
Beispiel #8
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['title' => 'required|unique:auctions|max:255', 'artist' => 'required|max:255', 'year' => 'required|integer|digits_between:3,4|max:2016', 'width' => 'required|numeric', 'height' => 'required|numeric', 'depth' => 'numeric', 'description' => 'required|max:255', 'condition' => 'required|max:255', 'origin' => 'required|max:255', 'picture' => 'required', 'minprice' => 'required|numeric|', 'buyout' => 'required|numeric|greater_than_field:minprice', 'date' => 'required|date|after:today', 'terms' => 'required|accepted']);
     $artist = Artist::where('name', $request->artist)->first();
     if (!$artist) {
         $artist = new Artist(['name' => $request->artist]);
     }
     $artist->save();
     $auction = new Auction(['title' => $request->title, 'description' => $request->description, 'start' => Carbon::now(), 'end' => $request->date, 'buy_now' => $request->buyout, 'price' => $request->minprice, 'status' => 'Active', 'style_id' => Style::Where('name', $request->style)->first()->id]);
     $artwork = new Artwork(['name' => $request->title, 'width' => $request->width, 'height' => $request->height, 'depth' => $request->depth, 'condition' => $request->condition, 'origin' => $request->origin, 'year' => $request->year]);
     $auction->save();
     $artwork->auction()->associate($auction);
     $artwork->save();
     // Picture save
     $imageName = $artwork->id . '.' . $request->file('picture')->getClientOriginalExtension();
     $artwork->image = $imageName;
     $request->file('picture')->move(base_path() . '/public/img/', $imageName);
     $artist->artworks()->save($artwork);
     $owner = $request->user();
     $owner->auctionsowner()->save($auction);
     return redirect('/auctions/' . $owner->id);
 }
Beispiel #9
0
 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;
 }
 public function create()
 {
     $styles = Style::all();
     return view('auctions.create')->withStyles($styles);
 }
Beispiel #11
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Style::create(array('theme_name' => 'default', 'body_backgroundColor' => '218, 173, 134', 'buttons_backgroundColor' => '117, 168, 202', 'buttons_borderColor' => '89, 105, 114', 'navBar_backgroundColor' => '201, 216, 197', 'menuModal_backgroundColor' => '255, 246, 253', 'user_id' => 1));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $user_id = Auth::id();
     $styles = Style::where('user_id', '=', $user_id)->first();
     return Response::json($styles);
 }
 protected function createStyles(array $styles)
 {
     foreach ($styles as $s) {
         Style::create(['name' => $s]);
     }
 }