本文整理匯總了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()]);
}