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

@@ -3,60 +3,40 @@
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Site;
class CreateTableSites extends Migration
{
private $convert = 'App\Models\Old\Setup';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('sites');
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sites', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('url');
$table->string("name");
$table->string('devurl')->nullable();
$table->text('aboutus')->nullable();
$table->json('address')->nullable();
$table->string('description')->nullable();
$table->string('email');
$table->string('phone')->nullable();
$table->string('fax')->nullable();
$table->string('logo')->nullable();
$table->string('favicon')->nullable();
$table->string('theme');
});
$table->increments('id');
$table->timestamps();
$table->string('url');
$table->string('devurl')->nullable();
$table->string('name');
$table->json('address')->nullable();
$table->string('description')->nullable();
$table->string('email');
$table->string('phone')->nullable();
$table->string('fax')->nullable();
$table->string('logo')->nullable();
$table->string('favicon')->nullable();
$table->string('theme');
});
}
if ($this->convert)
foreach (($this->convert)::all() as $o)
{
$oo = new Site;
$oo->url = rtrim($o->url,'/');
$oo->name = $o->site_details['name'];
$oo->email = $o->site_details['email'];
$oo->address = ['address1'=>$o->site_details['address1'],'address2'=>$o->site_details['address2'],'city'=>$o->site_details['city'],'state'=>$o->site_details['state'],'postcode'=>$o->site_details['pcode']];
$oo->phone = $o->site_details['phone'];
$oo->fax = $o->site_details['fax'];
$oo->theme = 'metronic-fe';
$oo->devurl = 'http://graytech';
$oo->save();
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sites');
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sites');
}
}