本文整理汇总了PHP中Brand::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Brand::all方法的具体用法?PHP Brand::all怎么用?PHP Brand::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brand
的用法示例。
在下文中一共展示了Brand::all方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
$product = Product::find($id);
$type = ProductType::all();
$brand = Brand::all();
return View::make('product.edit')->withProduct($product)->withBrand($brand)->withType($type);
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
$product = Product::find($id);
$departments = Department::all()->lists('name', 'id');
$categories = Category::all()->lists('name', 'id');
$brands = Brand::all()->lists('name', 'id');
$sizes = Size::all()->lists('name', 'id');
$colors = Color::all()->lists('name', 'id');
return View::make('admin::products.edit', compact('product', 'departments', 'categories', 'brands', 'sizes', 'colors'));
}
示例3: showBrands
public function showBrands()
{
Larasset::start('footer')->js('dataTables-min', 'dataTables-bootstrap', 'bootstrap_editable');
Larasset::start('header')->css('bootstrap_editable');
$ids = Brand::all()->lists('id');
if (!empty($ids)) {
$this->_monitorChildrenStatus($ids);
}
$data['brands'] = Brand::all();
$this->layout->title = "Active Brands of products";
$this->layout->content = View::make('admin.liststock.stocks', $data);
}
示例4: index
public static function index()
{
return function ($req, $res) {
$res->header('Content-Type', 'application/json');
$models = Brand::all();
$all = array();
foreach ($models as $model) {
# code...
$all[] = $model->as_array();
}
echo json_encode($all);
};
}
示例5: GetAllBrand
public function GetAllBrand()
{
return Brand::all();
}
示例6: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$brand = Brand::all();
View::share('selected_option', 'Agregar Marca');
return View::make('brand.add')->with('brand', $brand);
}
示例7: edit_product
public function edit_product()
{
$id = Request::segment(4) ? Request::segment(4) : 0;
$sub_title = Request::segment(4) ? "Edit Product" : "Add Product";
$product = Product::find($id);
$brands = Brand::all();
$stores = Store::all();
$selected_store_id = 0;
$selected_department_id = 0;
$selected_shelf_id = 0;
foreach ($stores as $store) {
$selected_store_id = $store->id;
break;
}
if ($product && $product->store_id) {
$selected_store_id = $product->store_id;
}
$departments = Department::where('store_id', $selected_store_id)->get();
foreach ($departments as $department) {
$selected_department_id = $department->id;
break;
}
if ($product && $product->department_id) {
$selected_department_id = $product->department_id;
}
$shelves = Shelf::where('department_id', $selected_department_id)->get();
foreach ($shelves as $shelf) {
$selected_shelf_id = $shelf->id;
break;
}
return View::make('admin.product_form')->with('title', 'Product')->with('sub_title', $sub_title)->with('product', $product)->with('brands', $brands)->with('stores', $stores)->with('departments', $departments)->with('shelves', $shelves)->with('selected_store_id', $selected_store_id)->with('selected_department_id', $selected_department_id)->with('selected_shelf_id', $selected_shelf_id);
}
示例8: getIndex
/**
* Display a listing of the resource.
*
* @return Response
*/
public function getIndex()
{
return View::make('main.brands')->with('brands', Brand::all());
}
示例9: get_product_add
public function get_product_add()
{
$categories = Category::where('top', '=', '1')->get();
$products = Product::all();
$brands = Brand::all();
$tags = DB::table("product_descriptions")->get('tag');
$_tmpholder = array();
$_strholder = '';
foreach ($tags as $tag) {
$_instance = explode(',', $tag->tag);
foreach ($_instance as $item) {
array_push($_tmpholder, $item);
}
}
$_tmpholder = array_unique($_tmpholder);
$numItems = count($_tmpholder);
$i = 0;
foreach ($_tmpholder as $item) {
$_strholder .= '"' . $item . '"';
if (++$i !== $numItems) {
$_strholder .= ',';
}
}
$attributes = AttributeGroup::with('getChildrenGroup')->where('top', '=', 1)->get();
$taxes = Tax::all();
return View::make('administrator.product_add')->with('categories', $categories)->with('products', $products)->with('brands', $brands)->with('tags', $_strholder)->with('attributes', $attributes)->with('taxes', $taxes);
}
示例10: function
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Route::get('brand', function () {
$categories = Category::all();
$brands = Brand::all();
return View::make('index')->with('categories', $categories)->with('brands', $brands);
});
示例11: companyCounterStat
public function companyCounterStat()
{
$this->widgetData = array('count' => count(Brand::all()));
$this->setupWidgetLayout(__METHOD__);
}
示例12: getAll
public function getAll()
{
$categories = Category::all();
$brands = Brand::all();
return View::make('Attch/index')->with('categories', $categories)->with('brands', $brands);
}