$admin_permissions = Permission::all(); // Teacher Role $teacher_permissions = $admin_permissions->filter(function ($permission) { return substr($permission->title, 0, 8) == 'teacher_'; });