コード例 #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;
 }
コード例 #4
0
 /**
  * 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
ファイル: Repository.php プロジェクト: jonphipps/Repositories
 /**
  * @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'));
 }
コード例 #9
0
 /**
  * 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));
 }