Exemplo n.º 1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     //        $tags = Tag::all();
     $tags = Tag::lists('name', 'id');
     $categories = Category::lists('title', 'id');
     return view('admin.create', compact('tags', 'categories'));
 }
Exemplo n.º 2
0
 /**
  * Show the form for creating a new Cruiseline.
  *
  * @return View
  */
 public function edit($id)
 {
     $article = Article::find($id);
     $tags = Tag::lists('name', 'id');
     $users = User::orderBy('name', 'ASC')->lists('name', 'id');
     return view('articles.edit', compact('article', 'tags', 'users'));
 }
Exemplo n.º 3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $instrumento = Instrumento::with('tags')->findOrFail($id);
     $tags_instrumento = Instrumento::obtenerTags($instrumento->tags);
     $tags = Tag::lists('nombre', 'id');
     return view('instrumentos.edit', compact('instrumento', 'tags', 'tags_instrumento'));
 }
Exemplo n.º 4
0
 /**
  * Hiển thị form cho việc cập nhật bài viết.
  *
  * @param  Article  $article
  * @param ArticleRequest $request
  * @return Response
  */
 public function edit(Article $article)
 {
     // Lấy all Category & Tags để hiển thị
     $categories = Category::lists('name', 'id');
     $tags = Tag::lists('name', 'id')->toArray();
     return view('admin.articles.edit', compact('article', 'categories', 'tags'));
 }
Exemplo n.º 5
0
 public function edit(Article $article)
 {
     $tags = Tag::lists("name", "id");
     $published_at = Carbon::now();
     $usert = $article->getTagListAttribute();
     return view('articles.edit', compact('article', 'usert', 'published_at', 'tags'));
 }
Exemplo n.º 6
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $tags = Tag::lists('name', 'id');
     $post = Post::findOrFail($id);
     $tags_exist = $post->tags->lists('id')->all();
     return view("posts.edit", compact("post", 'tags', 'tags_exist'));
 }
Exemplo n.º 7
0
 public function edit(Post $post)
 {
     $data['tags'] = Tag::lists('name', 'id');
     $data['pages'] = Page::where('status', 1)->lists('title', 'id');
     $data['post'] = $post;
     return view('post.update', $data);
 }
Exemplo n.º 8
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  Article  $article
  * @return \Illuminate\Http\Response
  */
 public function edit(Article $article)
 {
     $twitter = Auth::user()->twitter_token()->first();
     $hasTwitter = is_null($twitter) ? false : true;
     $tags = Tag::lists('name', 'id');
     return view('articles.edit', compact('article', 'tags', 'hasTwitter'));
 }
Exemplo n.º 9
0
 /** 
  * Edit the channel
  * @param $id
  */
 public function edit($id)
 {
     $channel = Channel::findOrFail($id);
     $tags = Tag::lists('name', 'id')->all();
     $tag_list = $channel->tags->lists('name', 'id');
     return view('channels.edit', compact('channel', 'tags', 'tag_list'));
 }
 public function edit($id)
 {
     $product = Product::find($id);
     $categories = Category::lists('title', 'id');
     $tags = Tag::lists('name', 'id');
     return view('admin.edit', compact('product', 'tags', 'categories'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $post = Post::findOrFail($id);
     $categories = Category::lists('name', 'id');
     $tags = Tag::lists('name', 'id');
     return view('posts.edit', compact('post', 'categories', 'tags'));
 }
Exemplo n.º 12
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $article = Article::findOrFail($id);
     $tags = \App\Tag::lists('name', 'id');
     $categories = \App\Category::getLeveledCategories();
     return view('admin.articles.edit', compact('article', 'tags', 'categories'));
 }
Exemplo n.º 13
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $comp = Post::lists('company_name', 'company_name');
     $cat = Category::lists('name', 'name');
     $tags = Tag::lists('name', 'name');
     $stateList = \DB::table('statess')->lists('name', 'name');
     return view('admin.pages.compose', compact('comp', 'stateList', 'tags', 'cat'));
 }
 public function edit(Article $article)
 {
     //$article = Article::findOrFail($id);
     //binded the wildcard article to this controller model
     //so don't need to fetch article
     $tags = \App\Tag::lists('name', 'id');
     return view('articles.edit', compact('article', 'tags'));
 }
Exemplo n.º 15
0
 /**
  * 修改文章页面
  * @param $id
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function edit($id)
 {
     $article = Article::with('hasOneDetail')->findOrFail($id);
     $article->detail = $article->hasOneDetail->detail;
     //        dd($article);
     $tags = Tag::lists('name', 'id');
     return view('articles.edit', compact('article', 'tags'));
 }
 public function edit($id)
 {
     $tags = \App\Tag::lists('name', 'id');
     // significa: dammi una lista di tutti i tag,
     // con chiave id e valore name
     $article = Article::findOrFail($id);
     return view('articles.edit', compact('article', 'tags'));
 }
Exemplo n.º 17
0
 public function edit(Blog $blog)
 {
     if (Gate::denies('update-post', $blog)) {
         abort(403);
     }
     $tags = \App\Tag::lists('name', 'id');
     return view('blogs/edit', compact('blog', 'tags'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $post = Post::findOrFail($id);
     if (Gate::denies('update', $post)) {
         abort(404, 'Nope');
     }
     $tags = Tag::lists('name', 'id');
     return view('posts.edit', compact('post', 'tags'));
 }
Exemplo n.º 19
0
 public function edit(Article $article)
 {
     // $article = Article::findOrFail($id);
     $tags = \App\Tag::lists('name', 'id');
     // return view('articles/edit')->with('article', $article)
     //                             ->with('tags', $tags);
     // consider using an alternative:
     return view('articles/edit', compact('article', 'tags'));
 }
 public function run()
 {
     $faker = Faker::create();
     $wordIds = Word::lists('id');
     $tagIds = Tag::lists('id');
     foreach (range(1, 30) as $index) {
         DB::table('tag_word')->insert(['word_id' => $faker->randomElement($wordIds->all()), 'tag_id' => $faker->randomElement($tagIds->all())]);
     }
 }
 public function run()
 {
     $faker = Faker::create();
     $tag_ids = Tag::lists('id');
     $article_ids = Article::lists('id');
     foreach (range(1, 30) as $index) {
         DB::table('article_tag')->insert(['article_id' => $faker->randomElement($article_ids->toArray()), 'tag_id' => $faker->randomElement($tag_ids->toArray())]);
     }
 }
 public function run()
 {
     $faker = Faker::create();
     $lessonIds = Lesson::lists('id');
     $tagIds = Tag::lists('id');
     foreach (range(1, 30) as $index) {
         DB::table('lesson_tag')->insert(['lesson_id' => $faker->randomElement($lessonIds->toArray()), 'tag_id' => $faker->randomElement($tagIds->toArray())]);
     }
 }
Exemplo n.º 23
0
 /**
  *
  *
  * the forms for editing the specified item.
  * Go to list.app/items/{id}/edit
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Item $item)
 {
     if ($item->user_id == \Auth::user()->id) {
         $tags = Tag::lists('name', 'id');
         return view('items.edit', compact('item', 'tags'));
     } else {
         \Session::flash('flash_message', "You aren't authorized to edit this item.");
     }
     return redirect('items');
 }
 public function editContent($id)
 {
     $currentContent = Content::findOrFail($id);
     // $t=Tag::findOrFail(5);
     // return ($t);
     $tags = Tag::lists('tagname', 'id');
     // dd ($t->content_list);
     $notif = self::getNotif();
     return view('adminPanel.editContent', compact('currentContent', 'tags', 'notif'));
 }
Exemplo n.º 25
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $categories = Category::lists('title', 'id');
     $tags = Tag::lists('name', 'id');
     $product = Product::find($id);
     $tagsProduct = $product->tags->lists('id')->toArray();
     $picture = $product->picture;
     $title = 'Edit a product';
     return view('admin.edit', compact('product', 'title', 'tags', 'categories', 'tagsProduct', 'catProduct', 'picture'));
 }
Exemplo n.º 26
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $categories = Category::lists('category')->all();
     $tags = Tag::lists('tag')->all();
     array_unshift($categories, '');
     unset($categories[0]);
     array_unshift($tags, '');
     unset($tags[0]);
     return view('article.create', compact('categories', 'tags'));
 }
Exemplo n.º 27
0
 public function create()
 {
     $interests = Auth::user()->interests;
     $tags = Tag::lists('name', 'id');
     if (count($interests) < 3) {
         return view('interests.create', compact('tags'));
     } else {
         return view('interests.index', compact('interests'));
     }
 }
Exemplo n.º 28
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $article = Article::findOrFail($id);
     $user = User::where('id', '=', $article->user_id)->first();
     if (!$this->adminOrCurrentUserOwns($article)) {
         throw new UnauthorizedException();
     }
     $tags = Tag::lists('tag_name', 'id');
     return view('articles.edit', compact('article', 'tags'));
 }
Exemplo n.º 29
0
 public function delete($id)
 {
     $article = Article::find($id);
     if (Auth::user()->id == $article->user_id) {
         $tags = Tag::lists('name', 'id');
         return view('articles.delete', compact('article'));
     } else {
         return redirect('articles/' . $article->slug)->with('error', 'You don\'t own that article');
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($slug)
 {
     $tags = Tag::lists('name', 'id');
     $article = Auth::user()->articles()->where('slug', '=', $slug)->first();
     if (is_null($article)) {
         flash()->message('This article does not belong to you');
         return redirect('article');
     }
     //return View('article')->with("allarticles", $output);
     return view('articles.edit', compact('article', 'tags'));
 }