Пример #1
0
 /**
  * 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');
 }
Пример #2
0
 /**
  * @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;
 }
Пример #3
0
 /**
  * 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);
 }
Пример #5
0
 /**
  * @param array $tagData
  *
  * @return Tag
  */
 public function create(array $tagData)
 {
     return $this->tagResource->create($tagData);
 }
Пример #6
0
 /**
  * @param array $data
  * @return mixed
  */
 public function create(array $data)
 {
     return $this->model->create($data);
 }
Пример #7
0
 /**
  * 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'));
 }
Пример #8
0
 /**
  * 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));
 }