/** * 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; }
/** * 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(); }
public function index() { return Currency::all(); }
/** * @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')); }
/** * List all currencies. * * @return Response */ public function index() { $currencies = Currency::all(); return view('admin/currencies/index', ['currencies' => $currencies]); }
public function getIndex() { return view('admin.currency.index', ['currencies' => Currency::all(), 'active_currency' => Currency::where('active', 1)->first()]); }