/** * Validate the position availability. * * @return bool */ private function validate() { if (!$this->preset->positionAvailable($this->request->x, $this->request->y)) { $this->errors = $this->setErrors(); return false; } return true; }
/** * Store the preset data. * * @return \Illuminate\Contracts\View\View */ public function store(Request $request) { $preset = Preset::create(['name' => $request->name, 'user_id' => Auth::user()->id]); return redirect()->route('presets.edit', $preset->id); }
/** * Register any other events for your application. * * @param \Illuminate\Contracts\Events\Dispatcher $events * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); Piece::observe(new AddSlugAttribute()); Preset::observe(new AddSlugAttribute()); }