public function run() { $link = Link::where('url', '=', 'Link')->take(1)->get(); $admin = Link::where('url', '=', 'Admin')->take(1)->get(); if (isset($link)) { Link::where('url', '=', 'Link')->update(['main' => true]); Link::where('url', '=', 'Admin')->update(['main' => true]); } else { Serverfireteam\Panel\Link::create(array('display' => 'Links', 'url' => 'Link', 'main' => true)); Serverfireteam\Panel\Link::create(array('display' => 'Admins', 'url' => 'Admin', 'main' => true)); } }
/** * Run the migrations. * * @return void */ public function up() { Schema::create('links', function ($table) { $table->increments('id'); $table->string('display'); $table->string('url'); $table->timestamps(); // We'll need to ensure that MySQL uses the InnoDB engine to // support the indexes, other engines aren't affected. $table->engine = 'InnoDB'; }); Serverfireteam\Panel\Link::create(array('display' => 'Links', 'url' => 'Link')); }