Courses

Creating CRM with Filament 3: Step-By-Step

Roles/Permissions: Manage Employees

You're reading a FREE PREVIEW of a PREMIUM course.
Summary of this lesson:
- Creating role system for admins and employees
- Implementing user management CRUD
- Adding employee assignments to customers
- Creating "My Customers" tab for employees
- Setting up access permissions

Next on our list - separating user roles. In our system, we need admins to manage the system settings and employees, while the employees themselves can only manage customers and nothing else:

In this lesson, we will do the following:

  • Create roles Model and Database structure
  • Create a user management page (CRUD)
  • Add employees to our Customers' table and form for admins to manage
  • Add employee changes to our customer history
  • Add an additional tab in Customers for My Customers - customers assigned to the employee

Creating Roles Model and Database structure

Let's start by creating our migration file:

Migration

Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});

Then, we can fill out our Model:

app/Models/Role.php

class Role extends Model
{
protected $fillable = ['name'];
}

Of course, we should also...

The full lesson is only for Premium Members.
Want to access all 17 text lessons of this course? (97 min read)

You also get:

  • 77 courses
  • Premium tutorials
  • Access to repositories
  • Private Discord