当前位置: 首页>>代码示例>>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;未经允许,请勿转载。