login as lecturer

This commit is contained in:
Benjamin Takats
2022-12-01 11:23:15 +01:00
parent 9ec6b24a69
commit ba07dca294
20 changed files with 72 additions and 41 deletions

View File

@@ -4,11 +4,9 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
@@ -16,19 +14,24 @@ return new class extends Migration
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('email')
->unique();
$table->timestamp('email_verified_at')
->nullable();
$table->string('password');
$table->rememberToken();
$table->foreignId('current_team_id')->nullable();
$table->string('profile_photo_path', 2048)->nullable();
$table->foreignId('current_team_id')
->nullable();
$table->string('profile_photo_path', 2048)
->nullable();
$table->boolean('is_lecturer')
->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()

View File

@@ -37,11 +37,13 @@ class DatabaseSeeder extends Seeder
'password' => bcrypt('1234'),
'remember_token' => Str::random(10),
]);
Team::create([
$team = Team::create([
'name' => 'Admin Team',
'user_id' => $user->id,
'personal_team' => true,
]);
$user->current_team_id = $team->id;
$user->save();
Country::create([
'name' => 'Deutschland',
'code' => 'de',