id(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->boolean('is_admin')->default(false); $table->rememberToken(); $table->string('bio', 1200)->nullable(); $table->string('picture')->nullable(); } /** * The attributes that are mass assignable. * * @var string[] */ protected $fillable = [ 'name', 'email', 'password', 'bio', 'picture', 'is_admin' ]; /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = [ 'password', 'remember_token', 'two_factor_recovery_codes', 'two_factor_secret', ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'email_verified_at' => 'datetime', ]; // Get posts from this user public function posts() { return $this->hasMany(Post::class); } // Get posts from this user public function comments() { return $this->hasMany(Comment::class); } // Implements necessary function to run with Filament public function canAccessFilament(): bool { return (bool) $this->is_admin; } }