Beispiel #1
0
 public function edit($id)
 {
     $post = Post::with('author', 'fields', 'category', 'tags')->findOrFail($id);
     $post->lock(auth()->user()->id);
     $categories = Category::all(['id', 'name']);
     $tags = Tag::all(['id', 'name']);
     $authors = Author::all(['id', 'name']);
     $fields = Field::all();
     return view('admin::posts.edit', compact('post', 'categories', 'tags', 'authors', 'fields'));
 }
 /**
  * @param FieldDestroyRequest $request
  * @param int $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy(FieldDestroyRequest $request, $id)
 {
     $field = Field::findOrFail($id);
     $field->delete();
     return redirect()->route('admin::post-fields.index');
 }
Beispiel #3
0
 /**
  * Remove the specified field from storage.
  *
  * @param  int $id
  * @return \Dingo\Api\Http\Response
  */
 public function destroy($id)
 {
     $field = $this->field->findOrFail($id);
     $field->delete();
     return $this->response->item($field, new FieldTransformer());
 }
 /**
  * @param int $id
  */
 public function destroy($id)
 {
     $field = Field::findOrFail($id);
     $field->delete();
 }