Example #1
0
 /**
  * Muestra un formulario para actualizar una post existente.
  *
  * @param  string $post
  * @return Response
  */
 public function edit(Post $post)
 {
     if (Gate::denies('edit-post', $post)) {
         session()->flash('message', 'No tienes permiso para editar posts');
         return redirect()->route('admin.posts.index');
     }
     $variables = ['post' => $post, 'tags' => Tag::lists('name', 'id'), 'categories' => Category::lists('name', 'id')];
     return view('admin/posts/edit', $variables);
 }
Example #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  string  $permalink
  * @return Response
  */
 public function edit($permalink)
 {
     $tags = Tag::lists('name', 'id');
     $video = Video::where('permalink', $permalink)->first();
     return view('admin.videos.edit', compact('tags', 'video'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  string $permalink
  * @return \Illuminate\Http\Response
  */
 public function edit($permalink)
 {
     $variables = ['artists' => Artist::orderBy('id')->lists('name', 'id'), 'release' => Release::where('permalink', $permalink)->first(), 'tags' => Tag::lists('name', 'id')];
     return view('admin/releases/edit', $variables);
 }
Example #4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  string $permalink
  * @return \Illuminate\Http\Response
  */
 public function edit($permalink)
 {
     $variables = ['categories' => Category::lists('name', 'id'), 'tags' => Tag::lists('name', 'id'), 'notice' => Notice::where('permalink', $permalink)->first()];
     return view('admin/news/edit', $variables);
 }
Example #5
0
 /**
  * Remove the specified tag from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     // Find the object with id
     $tag = Tag::findOrFail($id);
     // Delete the object to database
     $tag->delete();
     // Set session flash confirmation message
     session()->flash('message', 'Se eliminĂ³ la etiqueta "' . $tag->name . '" satisfactoriamente');
     // Redirect to tags index page
     return redirect()->route('admin.tags.index');
 }
Example #6
0
 /**
  * Display tag news
  * 
  * @param  Request $request
  * @param  string  $permalink
  * @return Response
  */
 public function tagNews(Request $request, $permalink)
 {
     $variables = ['page' => $this->permalinkTrait($permalink), 'categories' => Category::NewsCategories(), 'tags' => Tag::NewsTags(), 'tag' => Tag::publicTagNews($permalink)];
     return view('public/tag/news', $variables);
 }