Esempio n. 1
0
 /**
  * Gestion en singleton
  *
  * @return Config
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Esempio n. 2
0
 public function product_details()
 {
     $best_buy_key = \App\AppConfig::where('key', 'best_buy_api_key')->first();
     $id = Input::get('id');
     $bClient = new \GuzzleHttp\Client();
     $response = $bClient->request('GET', 'http://api.bestbuy.com/v1/products(productId=' . $id . ')?apiKey=' . $best_buy_key->value . '&format=json')->getBody();
     return view('main.product-detail')->with('product', json_decode($response, true)['products'][0]);
 }
 public function saveBasic(Request $request)
 {
     if ($config = AppConfig::find(1)) {
         $config->rua = $request->rua;
         $config->numero = $request->numero;
         $config->bairro = $request->bairro;
         $config->cidade = $request->cidade;
         $config->email = $request->email;
         $config->telefone = $request->telefone;
         $config->celular = $request->celular;
         $config->hora_abre = $request->hora_abre;
         $config->hora_fecha = $request->hora_fecha;
         $config->valor_min = $request->valor_min;
         $config->taxa = $request->taxa;
         $config->horario_func = $request->horario_func;
         $config->aberto = $request->aberto;
         $config->save();
     } else {
         AppConfig::create($request);
     }
     return redirect('/painel/configuracoes');
 }
Esempio n. 4
0
 public static function load()
 {
     $yaml = new Yaml();
     self::$config = $yaml->parse(file_get_contents("../app/config/config.yml"));
 }
 public function configuracoes()
 {
     return AppConfig::first();
 }
 public function mapa()
 {
     $config = AppConfig::first();
     return view('admin.mapaPedidos', compact('config'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $config = AppConfig::first();
     $entregadores = User::where('tipo', 'ENTREGA')->get();
     return view('admin.index', compact('config', 'pedidos'));
 }