本文整理汇总了PHP中app\models\Item::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::all方法的具体用法?PHP Item::all怎么用?PHP Item::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Item
的用法示例。
在下文中一共展示了Item::all方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show($id)
{
$invoice = Invoice::getInvoiceDetails($id);
$items = Item::all();
// print_r($items);
return view('invoice', ['invoice' => $invoice, 'id' => $id, 'items' => $items->getArray()]);
}
示例2: invoiceProfile
/**
* Add or Edit Form
*/
public function invoiceProfile($invoice_id)
{
// Validation Rules
$validator = Validator::make(['invoice_id' => $invoice_id], ['invoice_id' => 'integer']);
// If Validation Fails
if ($validator->fails()) {
return redirect('/customers')->withErrors($validator->messages()->toArray());
}
// Get the invoice model
$invoice = new Invoice($invoice_id);
// Invoice Items as an array
$items = $invoice->getItems();
// All Items Collection
$all_items = Item::all();
// Return the Invoice Profile View
return view('invoices.profile', ['invoice' => $invoice, 'items' => $items->getArray(), 'all_items' => $all_items->getArray()]);
}
示例3: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$item = Item::all();
// var_dump($item);exit;
return view('admin.item.index', ['item' => $item]);
}
示例4: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$items = Item::all();
return \View::make('list_item', compact('items'));
}
示例5: showAll
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function showAll()
{
$items = \App\Models\Item::all();
return view('toDo', ['items' => $items]);
}
示例6: items
public function items()
{
$items = \App\Models\Item::all();
return \View::make('items')->with('items', $items);
}
示例7: function
<?php
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
$items = \App\Models\Item::all();
return $items;
});
// ===== items route =====
Route::get('toDo', 'ItemsController@showForm');
Route::get('toDo', 'ItemsController@showAll');
Route::resource('items', 'ItemsController');
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web']], function () {
示例8: function
<?php
// Home route to show all tasks
$app->get('/', function () {
return view('list')->with('items', \App\Models\Item::all());
});
// Add a task
$app->post('/task/add', ['as' => 'task.add', 'uses' => 'App\\Http\\Controllers\\ListController@add']);
// Check a task as complete
$app->post('/task/check', ['as' => 'task.check', 'uses' => 'App\\Http\\Controllers\\ListController@check']);
// Uncheck a task
$app->post('/task/uncheck', ['as' => 'task.uncheck', 'uses' => 'App\\Http\\Controllers\\ListController@unCheck']);
// Remove a task
$app->post('/task/remove', ['as' => 'task.remove', 'uses' => 'App\\Http\\Controllers\\ListController@remove']);
示例9: showAll
public function showAll()
{
$items = Item::all();
return view('item_all', ['items' => $items->getArray()]);
}
示例10: index
public function index()
{
return Item::all()->toArray();
}
示例11: index
/**
* 查看商品
*
*/
public function index()
{
$item = Item::all();
return view('item.index', ['item' => $item]);
}