本文整理汇总了PHP中app\Category::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::lists方法的具体用法?PHP Category::lists怎么用?PHP Category::lists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Category
的用法示例。
在下文中一共展示了Category::lists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$categories = Category::lists('name', 'id');
$merchants = Merchant::lists('name', 'id');
$coupon = Coupon::find($id);
return view('admin.coupon.update', compact('categories', 'merchants'))->with('coupon', $coupon);
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$title = 'Update Category Information';
$category = Category::findOrFail($id);
$categories = Category::lists('title', 'id')->toArray();
return view('private.category.edit', compact('title', 'category', 'categories'));
}
示例3: edit
/**
* 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'));
}
示例4: edit
public function edit($id)
{
$countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
$categories = Category::lists('category', 'category')->all();
$competition = Competition::whereId($id)->firstOrFail();
return view('backend.competitions.edit', compact('competition', 'countries', 'categories'));
}
示例5: filterByCategory
/**
* Filter products by category
*
* @param $request
* @return Response
*/
public function filterByCategory(Request $request)
{
$title = 'Product Listing';
$categories = Category::lists('title', 'id')->toArray();
$products = Product::select(DB::raw("products.id, products.name, products.photo"))->leftJoin('category_product', 'category_product.product_id', '=', 'products.id')->whereIn('category_product.category_id', $request->input('category_id'))->groupBy('product_id')->paginate(10);
return view('home', compact('title', 'categories', 'products'));
}
示例6: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//dd($id);
$issues = Category::lists('title', 'id');
$file = Book::findOrFail($id);
return view('book.edit', compact('file', 'issues'));
}
示例7: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
view()->composer(['products.partials.form', 'partials.nav', 'partials.sidebar'], function ($view) {
$view->with('categories', Category::lists('name', 'id'));
$view->with('manufacturers', Manufacturer::lists('name', 'id'));
});
}
示例8: edit
/**
* 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'));
}
示例9: __construct
public function __construct()
{
View::composer('partials.nav', function ($view) {
$categories = Category::lists('title', 'id');
$view->with(compact('categories'));
});
}
示例10: create
/**
* 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'));
}
示例11: edit
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'));
}
示例12: create
/**
* Montre la vue pour créer un article
*
* @return Response
*/
public function create(Request $request)
{
$auth_id = Auth::user()->id;
$categories = Category::lists('name', 'id');
$jobs = Job::lists('name', 'id');
return view('admin.posts.create', compact('auth_id', 'categories', 'jobs'));
}
示例13: edit
/**
* Show the form for editing the specified resource.
*
* @param Quote $quote
*
* @return Response
* @internal param int $id
*/
public function edit(Quote $quote)
{
$authors = Author::lists('name', 'id')->all();
$categories = Category::lists('name', 'id')->all();
$categoriesOfImages = ImageCategory::lists('name', 'id')->all();
return view('admin.quote.edit', compact('quote'))->withTitle('Edit: ' . $quote->title)->withAuthors($authors)->withCategories($categories)->with('categoriesOfImages', $categoriesOfImages);
}
示例14: profile
public function profile($id)
{
$images = Auth::User()->uploaded_pictures;
$categories = Category::lists('category_name', 'category_id');
$user = User::findOrFail($id);
return view('templates/singleProfile')->with(compact('user', 'images', 'categories'));
}
示例15: edit
public function edit($id, $extra = array())
{
$vara = \App\Product::find($id);
$flokkar = array_merge([0 => ' - Veldu flokk - '] + \App\Category::lists('title', 'id')->toArray());
$extra['flokkar'] = $flokkar;
$extra['selectedFlokkurId'] = $vara->{$vara->parent_key} ?: 0;
return parent::edit($id, $extra);
}