Removed redundant items, upgraded to laravel 5.6

This commit is contained in:
Deon George
2018-04-10 21:23:13 +10:00
parent 33658e37a3
commit f9e3b2927a
588 changed files with 35299 additions and 90438 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Schema;
use Closure;
use App\Models\{Site};
use Config;
@@ -26,10 +27,15 @@ class SetSite
public function handle($request, Closure $next)
{
// @todo Figure out how to know if this is an API call - and deny it if it's not in the database.
$so = Site::where('url',$request->root())
->orwhere('devurl',$request->root())
// @todo With an API call, we would use ->firstorfail();
->first();
$so = NULL;
if (Schema::hasTable('site'))
{
$so = Site::where('url',$request->root())
->orwhere('devurl',$request->root())
// @todo With an API call, we would use ->firstorfail();
->first();
}
// If we dont exist, we'll return a fake model.
if (! $so) {