本文整理汇总了PHP中app\models\Currency::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::all方法的具体用法?PHP Currency::all怎么用?PHP Currency::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Currency
的用法示例。
在下文中一共展示了Currency::all方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: globalData
/**
* Prepare global variables.
* @return array
*/
public static function globalData()
{
if (!Auth::check()) {
$rows = null;
$cart = null;
$grandTotal = null;
} else {
$rows = Cart::instance(auth()->id())->count(false);
$cart = Cart::instance(auth()->id())->content();
$grandTotal = Cart::instance(auth()->id())->total();
}
$data = array('menu' => self::getMenuData(self::$parent_id), 'header' => Setting::findOrFail(1), 'rows' => $rows, 'cart' => $cart, 'grand_total' => $grandTotal, 'currencies' => Currency::all());
return $data;
}
示例2: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('course')->delete();
Model::unguard();
$faker = Faker\Factory::create();
$currencies = Currency::all()->toArray();
DB::table('course')->insert([['currency_id' => $currencies[0]['id'], 'course_purchase' => 5.4, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[1]['id'], 'course_purchase' => 5.0, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[2]['id'], 'course_purchase' => 1.03, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[3]['id'], 'course_purchase' => 1.7, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[4]['id'], 'course_purchase' => 1.7, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[5]['id'], 'course_purchase' => 1.0, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[6]['id'], 'course_purchase' => 0.1, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[7]['id'], 'course_purchase' => 0.3, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[8]['id'], 'course_purchase' => 0.1, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[9]['id'], 'course_purchase' => 0.00014, 'wallet' => $faker->creditCardNumber], ['currency_id' => $currencies[10]['id'], 'course_purchase' => 0.0, 'wallet' => $faker->creditCardNumber]]);
Model::reguard();
}
示例3: index
public function index()
{
return Currency::all();
}
示例4: create
/**
* @GET("/purchase/create", as="purchase.create")
* @param Purchase $purchase
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function create(Purchase $purchase)
{
$user = \Auth::user();
$currencies = Currency::all();
return view('balance.create', compact('purchase', 'user', 'currencies'));
}
示例5: index
/**
* List all currencies.
*
* @return Response
*/
public function index()
{
$currencies = Currency::all();
return view('admin/currencies/index', ['currencies' => $currencies]);
}
示例6: getIndex
public function getIndex()
{
return view('admin.currency.index', ['currencies' => Currency::all(), 'active_currency' => Currency::where('active', 1)->first()]);
}