/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * * @return \Illuminate\Http\Response */ public function store(Request $request) { /** @var Category $category */ $category = $this->category->create(['name' => $request->get('name')]); $this->webUi->successMessage("Created new category `{$category->name}`."); return $this->webUi->redirect('categories.index'); }
/** * @param UploadedFile $upload * * @throws \Symfony\Component\HttpFoundation\File\Exception\FileException * * @return Image */ public function storeUploadedImage(UploadedFile $upload) : Image { $newImage = $this->imageResource->create(['filename' => uniqid('', true) . $upload->getClientOriginalName()]); $upload->move(storage_path('image'), $newImage->filename()); $this->dispatcher->fire(new NewImageEvent($newImage)); return $newImage; }
/** * Create a new item * * @param array $data * @return mixed */ public function create(array $data) { $item = $this->builder->create($data); // Reset the query builder $this->newBuilder(); return $item; }
/** * Save a single notification sent * * @param array $info * @return Notification */ public function storeSingle(array $info) { return $this->notification->create($info); }
/** * @param array $tagData * * @return Tag */ public function create(array $tagData) { return $this->tagResource->create($tagData); }
/** * @param array $data * @return mixed */ public function create(array $data) { return $this->model->create($data); }
/** * Add a category to the DB. * * @param array $name * @param $text * @return static */ public function add($name, $text) { return $this->categoryModel->create(compact('name', 'text')); }
/** * Create a new group * * @param $name * @return \Illuminate\Database\Eloquent\Model */ public function create($name) { return $this->groupModel->create(compact('name')); }
/** * Save a new model and return the instance. * * @param array $attributes * @return \Illuminate\Database\Eloquent\Model */ public function create(array $attributes = []) { return $this->model->create($this->filterAttributes($attributes)); }