當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tag::all方法代碼示例

本文整理匯總了PHP中app\Tag::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tag::all方法的具體用法?PHP Tag::all怎麽用?PHP Tag::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Tag的用法示例。


在下文中一共展示了Tag::all方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index($username)
 {
     $articles = Article::where('user_id', '=', auth()->user()->id)->orderBy('created_at', 'desc')->get();
     $categories = Category::all();
     $tags = Tag::all();
     return view('articles.new')->with(['articles' => $articles, 'categories' => $categories, 'tags' => $tags]);
 }
開發者ID:otsaan,項目名稱:e-blog,代碼行數:7,代碼來源:ArticleController.php

示例2: editTag

 public function editTag($id)
 {
     $notif = self::getNotif();
     $currentTag = Tag::findOrFail($id);
     $tags = Tag::all();
     return view('adminPanel.editTag', compact('tags', 'currentTag', 'notif'));
 }
開發者ID:KunwarSingh,項目名稱:Summer-15-Intern-Work,代碼行數:7,代碼來源:WebUIMaintController.php

示例3: tag

 public function tag($name)
 {
     $tag = \App\Tag::where('name', '=', $name)->firstOrFail();
     $tags = \App\Tag::all();
     $posts = $tag->posts;
     return view('frontend.pages.tag')->with('posts', $posts)->with('tags', $tags)->with('tag', $tag);
 }
開發者ID:KirillVladimirov,項目名稱:usefulcode.ru-laravel,代碼行數:7,代碼來源:BlogController.php

示例4: __construct

 public function __construct()
 {
     $this->postParser = new PostParser();
     $this->tags = Tag::all();
     $this->dificultyLevels = PostDificulty::all();
     $this->posts = Post::all();
 }
開發者ID:joaumg-deprecated,項目名稱:joaumg_com,代碼行數:7,代碼來源:PostTableSeeder.php

示例5: tagTattoo

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function tagTattoo()
 {
     $user = Auth::user();
     $tattoos = Tattoo::where('tags_count', 0)->paginate(20);
     $tags = Tag::all();
     return view('admin.tagTattoo', ['tattoos' => $tattoos, 'tags' => $tags]);
 }
開發者ID:axovel,項目名稱:tattoo,代碼行數:12,代碼來源:AdminController.php

示例6: index

 /** 
  * List the tags 
  * @param $date
  */
 public function index()
 {
     $tags = Tag::all();
     // return $articles;
     // return view('articles.index')->with('articles', $articles);
     return view('tags.index', compact('tags'));
 }
開發者ID:appliaison,項目名稱:simplecms,代碼行數:11,代碼來源:TagController.php

示例7: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     $post = Post::find($id);
     $tags = Tag::all();
     $title = 'Editer une conférence';
     return view('dashboard.edit', compact('post', 'tags', 'title'));
 }
開發者ID:patlegris,項目名稱:ConfPHP,代碼行數:13,代碼來源:PostController.php

示例8: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::Create();
     foreach (range(1, 10) as $seededItem) {
         User::create(['first_name' => $faker->name, 'last_name' => $faker->name, 'password' => Hash::make('123456'), 'type' => false, 'sex' => $faker->boolean(), 'email' => $faker->email, 'date_of_birth' => $faker->date('Y-m-d')]);
     }
     $users = User::all()->lists('id')->toArray();
     foreach (range(1, 100) as $seededItem) {
         Post::create(['user_id' => $faker->randomElement($users), 'body' => $faker->text, 'vote_count' => 0]);
     }
     $posts = Post::all()->lists('id')->toArray();
     Comment::create(['user_id' => $faker->randomElement($users), 'body' => $faker->text, 'vote_count' => 0, 'parent_id' => null]);
     foreach (range(1, 100) as $seededItem) {
         Post_Vote::create(['user_id' => $faker->randomElement($users), 'post_id' => $faker->randomElement($posts), 'up' => $faker->boolean()]);
         Comment::create(['user_id' => $faker->randomElement($users), 'parent_id' => $faker->randomElement(Comment::all()->lists('id')->toArray()), 'post_id' => $faker->randomElement($posts), 'body' => $faker->text, 'vote_count' => 0]);
         Tag::create(['name' => $faker->text, 'private' => $faker->boolean()]);
     }
     $comments = Comment::all()->lists('id')->toArray();
     $tags = Tag::all()->lists('id')->toArray();
     foreach (range(1, 100) as $seededItem) {
         Comment_Vote::create(['user_id' => $faker->randomElement($users), 'comment_id' => $faker->randomElement($comments), 'up' => $faker->boolean()]);
         Tag_User::create(['user_id' => $faker->randomElement($users), 'tag_id' => $faker->randomElement($tags)]);
         Post_Tag::create(['tag_id' => $faker->randomElement($tags), 'post_id' => $faker->randomElement($posts)]);
     }
 }
開發者ID:khaled-barca,項目名稱:MyTunnelVision,代碼行數:30,代碼來源:TableSeeder.php

示例9: tagged

 /**
  * Display a listing of the resource associated with the tag name.
  *
  * @param Tag $tag
  * @return \Illuminate\Http\Response
  */
 public function tagged(Tag $tag)
 {
     $admin = User::first();
     $tags = Tag::all();
     $articles = $tag->publishedArticles()->get();
     $currentTag = $tag;
     return view($this->theme() . 'home', compact('articles', 'currentTag', 'admin', 'tags'));
 }
開發者ID:realnerdo,項目名稱:portfolio,代碼行數:14,代碼來源:ThemeController.php

示例10: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $product = Product::find($id);
     $tags = Tag::all();
     $cats = $this->categoryTitleAndId();
     $product->status == 'published' ? $published = true : ($published = false);
     return view('admin.product.edit', compact('product', 'cats', 'tags'));
 }
開發者ID:OrestHk,項目名稱:e-starwars,代碼行數:14,代碼來源:ProductController.php

示例11: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($slug)
 {
     $category = Category::where('slug', $slug)->first();
     $articles = $category->articles()->get();
     $categories = Category::all();
     $tags = Tag::all();
     return view('articles.categories.show', compact('articles', 'categories', 'tags'));
 }
開發者ID:joandong2,項目名稱:blog,代碼行數:14,代碼來源:CategoriesController.php

示例12: tag

 public function tag($id)
 {
     $categories = $this->categories();
     $articles = Tag::findOrFail($id)->articles()->orderBy('id', 'desc')->paginate(8);
     $tag = Tag::findOrFail($id);
     $tags = Tag::all();
     return view('home.tag', compact('categories', 'tag', 'articles', 'tags'));
 }
開發者ID:axhello,項目名稱:laravel-blog-demo,代碼行數:8,代碼來源:HomeController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tags = Tag::all();
     foreach ($tags as $tag) {
         echo $tag->tag;
         echo '<br>';
     }
     // return view('tags/tags')->with(['tags' => $tags]);
 }
開發者ID:cclass,項目名稱:taskboard,代碼行數:14,代碼來源:TagController.php

示例14: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('partials._blog-aside', function ($view) {
         $view->with('postDate', Article::all()->groupBy(function ($date) {
             return Carbon::parse($date->created_at)->format('M-y');
         }));
         $view->with('tags', Tag::all());
     });
 }
開發者ID:Adam-Abstrct,項目名稱:AJDigital,代碼行數:14,代碼來源:ViewComposerServiceProvider.php

示例15: get_tags

 public function get_tags()
 {
     $tags = Tag::all()->toArray();
     $result = [];
     foreach ($tags as $tag) {
         $result[] = ['id' => $tag['id'], 'text' => $tag['name']];
     }
     return $result;
 }
開發者ID:Cih2001,項目名稱:hamidreza,代碼行數:9,代碼來源:ApiController.php


注:本文中的app\Tag::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。