D
D
Dmitry Kuznetsov2015-08-15 19:34:19
Laravel
Dmitry Kuznetsov, 2015-08-15 19:34:19

Offline website, how to make Laravel 4?

Hello. I'm building a website and ran into a problem. It is necessary to make it so that the site is disabled page appears if the configs indicate that the site is disabled.
Tried to put in "app\start\global.php" the "Engine:siteOffline();" model, but the error page didn't show up.
Model code:

public static function siteOnline(){
    /**
    * Включён ли сайт
    */
    $online = Config::get('config.engine.online');

    if($online['online'] == false){
      // Если сайт выключен
      return View::make('errors.offline')->with('offline', $online);
    }
  }

The model is working, but for some reason it does not work, namely, the template is not shown.
I tried to shove it into filters.php, but pictures are not loading for me, but I need them. And yes, this method is not correct, but I already xs what to do :(
Can someone tell me, huh!?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-08-15
@dima9595

There is also a standard mechanism .
If you want to run the command programmatically and not through the terminal, the documentation describes in detail how to do this (documentation for 5.1, but also works in the 4th version).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question