App\Http\Controllers\SetupController::checkTablesExist PHP Method

checkTablesExist() public static method

Check if the given tables exist in current database.
public static checkTablesExist ( array $tables = ['users', 'closets', 'players', 'textures', 'options'] ) : boolean
$tables array [description]
return boolean
    public static function checkTablesExist($tables = ['users', 'closets', 'players', 'textures', 'options'])
    {
        foreach ($tables as $table_name) {
            // prefix will be added automatically
            if (!Schema::hasTable($table_name)) {
                return false;
            }
        }
        return true;
    }

Usage Example

 protected function checkInstallation()
 {
     // redirect to setup wizard
     if (!SetupController::checkTablesExist()) {
         return redirect('/setup')->send();
     }
     if (!SetupController::checkTextureDirectory()) {
         throw new PrettyPageException(trans('setup.file.permission-error'), -1);
     }
     if (version_compare(config('app.version'), option('version', ''), '>')) {
         return redirect('/setup/update')->send();
     }
     return true;
 }