本文整理汇总了PHP中app\Category::orderby方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::orderby方法的具体用法?PHP Category::orderby怎么用?PHP Category::orderby使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Category
的用法示例。
在下文中一共展示了Category::orderby方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
$artists = ['default' => 'Choose an artist'] + Artist::orderby('name', 'ASC')->lists('name', 'id')->all();
$eras = ['default' => 'Choose an era'] + Era::lists('name', 'id')->all();
$categories = ['default' => 'Choose a category'] + Category::orderby('name', 'ASC')->lists('name', 'id')->all();
$colors = ['default' => 'Choose a color'] + Color::orderby('colorEnglish', 'ASC')->lists('colorEnglish', 'id')->all();
$styles = ['default' => 'Choose a style'] + Style::orderby('name', 'ASC')->lists('name', 'id')->all();
$newestAuction = Auction::where('FK_status_id', '=', 1)->orWhere('FK_status_id', '=', 3)->orderBy('created_at', 'desc')->first();
$timenow = Carbon::now()->addDays(1)->toDateString();
//de datum nu
return View::make('create')->with('artists', $artists)->with('eras', $eras)->with('categories', $categories)->with('colors', $colors)->with('styles', $styles)->with('newestAuction', $newestAuction)->with('timenow', $timenow);
}
示例2: archives
public function archives()
{
$categories = $this->category->orderby('name', 'asc')->where('archive', 1)->get();
return view('admin.pages.categories.index', compact('categories'));
}
示例3: boot
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
// Currencies
view()->composer(array('customers.edit', 'customer_invoices.create', 'companies.edit', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('currencyList', \App\Currency::lists('name', 'id'));
});
// Customer Groups
view()->composer(array('customers.edit'), function ($view) {
$view->with('customer_groupList', \App\CustomerGroup::lists('name', 'id'));
});
// Payment Methods
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('payment_methodList', \App\PaymentMethod::lists('name', 'id'));
});
// Sequences
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('sequenceList', \App\Sequence::lists('name', 'id'));
});
// Invoice Template
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('customerinvoicetemplateList', \App\Template::where('model_name', '=', 'CustomerInvoice')->lists('name', 'id'));
});
// Carriers
view()->composer(array('customers.edit', 'customer_invoices.create', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('carrierList', \App\Carrier::lists('name', 'id'));
});
// Sales Representatives
view()->composer(array('customers.edit', 'customer_invoices.create'), function ($view) {
$view->with('salesrepList', \App\SalesRep::select(DB::raw('concat (firstname," ",lastname) as name, id'))->lists('name', 'id'));
});
// Price Lists
view()->composer(array('customers.edit', 'customer_groups.create', 'customer_groups.edit'), function ($view) {
$view->with('price_listList', \App\PriceList::lists('name', 'id'));
});
// Warehouses
view()->composer(array('products.create', 'stock_movements.create', 'configurationkeys.key_group_2', 'customer_invoices.create'), function ($view) {
$whList = \App\Warehouse::with('address')->get();
$list = [];
foreach ($whList as $wh) {
$list[$wh->id] = $wh->address->alias;
}
$view->with('warehouseList', $list);
// $view->with('warehouseList', \App\Warehouse::lists('name', 'id'));
});
// Taxes
view()->composer(array('customer_invoices.create', 'products.create', 'products.edit'), function ($view) {
$view->with('taxList', \App\Tax::orderby('percent', 'desc')->lists('name', 'id'));
});
view()->composer(array('products.create', 'products.edit', 'customer_invoices.create'), function ($view) {
$view->with('taxpercentList', \App\Tax::lists('percent', 'id'));
});
// Languages
view()->composer(array('users.create', 'users.edit'), function ($view) {
$view->with('languageList', \App\Language::lists('name', 'id'));
});
// Categories
view()->composer(array('products.create', 'products._panel_main_data'), function ($view) {
$view->with('categoryList', \App\Category::orderby('name', 'asc')->lists('name', 'id'));
});
// Stock Movement Types
view()->composer(array('stock_movements.index', 'stock_movements.create'), function ($view) {
$view->with('movement_typeList', \App\StockMovement::stockmovementList());
});
}