hasMany('Book', 'author_id'); } public function role() { return $this->hasOne('Role'); } /** * Check if we need to run the schema. */ public static function executeSchema() { $schema = Schema::connection('mysql'); if (!$schema->hasTable('users')) { Schema::connection('mysql')->create('users', function ($table) { $table->increments('id'); $table->string('name'); $table->timestamps(); }); } } }