本文整理汇总了PHP中app\Item::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::all方法的具体用法?PHP Item::all怎么用?PHP Item::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Item
的用法示例。
在下文中一共展示了Item::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show()
{
$info = new Item();
$info->setTable($this->getLoginUsername());
//$info->setTable($this->getLoginUsername());
$list = $info->all($this->getLoginUsername(), array('taskname', 'deadline', 'description', 'important'));
return view('auth.profile')->with(array('username' => $this->getLoginUsername(), 'list' => $list));
}
示例2: map
public function map(){
$items = Item::all();
//$items = Item::distance(0.1,'45.05,7.6667')->get();
return view('items.map')->with(['items'=>$items]);
}
示例3: newsale
function newsale(Request $request)
{
$values = $request->all();
$sale = Sale::create($values);
$sales = Sale::all();
$items = Item::all();
$vendors = Vendor::all();
return view('stockmaster.sales', ['vendors' => $vendors, 'newsale' => $sale, 'items' => $items, 'user' => Auth::user()]);
}
示例4: __invoke
public function __invoke() : View
{
$extractShorName = function ($item) {
return $item->state->getShortName();
};
$allItems = Item::all();
$newItems = P::pipe(P::filter(P::pipe($extractShorName, P::eq('new'))), 'P::size');
return view('main')->with('items', $allItems)->with('remaining_item_count', $newItems($allItems));
}
示例5: booking
public function booking(Request $request)
{
$values = $request->all();
$booking = Booking::create($values);
$user = Auth::user();
$items = Item::all();
$i = 0;
return view('customer', ['i' => $i, 'booking' => $booking, 'user' => $user, 'items' => $items]);
}
示例6: viewCatDets
/**
* @return $this
*/
public function viewCatDets($catName)
{
$imDets = DB::select(DB::raw("SELECT * FROM items WHERE catRef = (SELECT catID FROM categories WHERE catName ='{$catName}')"));
// $catDets = DB::select(DB::raw("SELECT * FROM categories WHERE "))
$categories = Category::all();
$items = Item::all();
return view('pages/Main/categoryView', compact('categories', 'items', 'imDets', 'catName'));
//return view('pages/Main/categoryView')->with('imDets',$imDets);
}
示例7: create
public function create()
{
$items = Item::all();
if (count($items) < 1) {
return redirect()->action('ItemsController@index')->with('message', 'Anda belum memasukan data produk');
} else {
return view('itemin.create', compact('items'));
}
}
示例8: viewCatDets
/**
* @param $catName
* this function handle the viewing of category of products
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function viewCatDets($catName)
{
//retreive the categories images with product details based on the user click
$imDets = DB::select(DB::raw("SELECT * FROM items WHERE catRef = (SELECT catID FROM categories WHERE catName ='{$catName}')"));
$categories = Category::all();
$items = Item::all();
$data = session()->get('items');
// return json_encode($imDets);
return view('pages/Main/categoryView', compact('categories', 'items', 'imDets', 'catName', 'data'));
}
示例9: countNewAndDoneItems
/**
* Get counts of items that are new and which ones are completed
* @return Tuple(int, int, int)
*/
public static function countNewAndDoneItems() : Tuple
{
$countNewAndPast = P::partition(function ($item) {
$name = $item->state->getShortname();
return $name === 'expired' || $name === 'completed';
}, Item::all());
list($done, $new) = $countNewAndPast;
$counts = Tuple::create('integer', 'integer');
return $counts(count($done), count($new));
}
示例10: getUserProfile
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function getUserProfile()
{
$user = Auth::user();
$items = Item::all();
$profileList = Profile::where('user_id', '=', 1)->lists('characterName', 'id');
// $request = /* where (useSkills = profile_id)
// return [item_id => [tier_id], item_id => [tier_id]] */
$itemList = useSkill::where('profile_id', '=', 1)->join('items', 'items.id', '=', 'item_id')->join('tiers', 'tiers.id', '=', 'tier_id')->groupBy('items.name')->get(['items.name', 'tiers.tier']);
return view('profile.profile', compact('items', 'profileList', 'itemList'));
}
示例11: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$items = Item::all();
foreach ($items as $item) {
$imgs = glob(storage_path('app') . "/prodimag/" . trim($item->codigo) . "*-G*");
$item->imagenes = count($imgs) > 0 ? true : false;
$item->imagen = count($imgs) > 0 ? substr($imgs[rand(0, count($imgs) - 1)], -15, 9) : NULL;
$item->save();
}
}
示例12: index
/**
* Get all items from the database and display it.
* Go to: list.app/items
* @return \Illuminate\Http\Response
*/
public function index()
{
$items = array();
foreach (Item::all() as $item) {
if (\Auth::user()->id == $item->user_id) {
array_push($items, $item);
}
}
return view('items.index', compact('items'));
}
示例13: postRegister
public function postRegister(Request $request)
{
$validator = $this->registrar->validator($request->all());
if ($validator->fails()) {
$items = Item::all();
$i = 0;
return view('main', ['i' => $i, 'items' => $items, 'errors' => $validator->errors(), 'input' => $request->all()]);
}
$user = $this->registrar->create($request->all());
$this->auth->login($user);
return $this->authenticated($request, $user);
}
示例14: getItems
public function getItems()
{
$itemlist = Item::all();
$items = Item::all();
$itemspack = [];
foreach ($items as $item) {
$uom = BulkUnit::where('uom_id', $item->uom_id)->lists('name');
$itemspack[$item->uom_id] = $uom;
}
$jsonified = json_encode($itemspack);
$data = ['items' => $jsonified];
return view('operations/purchase/index', $data, compact('itemlist'));
}
示例15: booking
function booking(Request $request)
{
$items = Item::all();
$i = 0;
$values = $request->all();
$rules = ['name' => 'required|max:100', 'adrsl1' => 'required', 'adrsl2' => 'required', 'place' => 'required', 'pin' => 'required|digits:6', 'email' => 'required|email', 'phone' => 'required|digits:10', 'pickdate' => 'required|date_format:Y-m-d|after:today'];
$validator = Validator::make($request->all(), $rules);
if ($validator->fails()) {
return view('main', ['i' => $i, 'items' => $items, 'req_errors' => $validator->errors(), 'req_inputs' => $request->all()]);
// ['status'=>'fail','error'=>'invalid data',,];
}
$booking = Booking::create($values);
return view('main', ['i' => $i, 'booking' => $booking, 'items' => $items]);
}