Файл: app/Http/Controllers/HomeController.php
Строк: 59
<?php
namespace AppHttpControllers;
use AppModelsPlan;
use IlluminateSupportFacadesAuth;
class HomeController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        // $this->middleware('auth');
    }
    /**
     * Show the home page.
     *
     * @return IlluminateContractsFoundationApplication|IlluminateContractsViewFactory|IlluminateHttpRedirectResponse|IlluminateViewView
     */
    public function index()
    {
        // If there's no DB connection setup
        if (!env('DB_DATABASE')) {
            return redirect()->route('install');
        }
        // If the user is logged-in, redirect to dashboard
        if (Auth::check()) {
            return redirect()->route('dashboard');
        }
        // If there's a custom site index
        if (config('settings.index')) {
            return redirect()->to(config('settings.index'), 301);
        }
        // If there's a payment processor enabled
        if (paymentProcessors()) {
            $plans = Plan::where('visibility', 1)->orderBy('position')->orderBy('id')->get();
        } else {
            $plans = null;
        }
        return view('home.index', ['plans' => $plans]);
    }
}