Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

redroseamit's avatar

facing error during db seeding .


C:\xampp\htdocs\socialmedialv>php artisan db:Seed
Seeding: LaratrustSeeder
Truncating User, Role and Permission tables

   Error

  Class 'Laratrust\Models\LaratrustRole' not found

  at C:\xampp\htdocs\socialmedialv\app\Role.php:7
     3| namespace App;
     4|
     5| use Laratrust\Models\LaratrustRole;
     6|
  >  7| class Role extends LaratrustRole
     8| {
     9|     public $guarded = [];
    10| }
    11|

  1   C:\xampp\htdocs\socialmedialv\vendor\composer\ClassLoader.php:444
      include()

  2   C:\xampp\htdocs\socialmedialv\vendor\composer\ClassLoader.php:322
      Composer\Autoload\includeFile("C:\xampp\htdocs\socialmedialv\vendor\composer/../../app/Role.php")

0 likes
1 reply
automica's avatar
automica
Best Answer
Level 54

@redroseamit in your Role Model, you should have the following beat the top of the file.

use Laratrust\Models\LaratrustRole;

if its not there, you'll need to add it.

if that doesn't resolve your issue, ensure you have installed the laratrust package

1 like

Please or to participate in this conversation.