Skip to content

Commit f6500fb

Browse files
authored
Merge pull request #196 from fleetbase/dev-1.6.37
Remove the `CompanyScope` from the base model
2 parents 438c9d2 + dab2e0b commit f6500fb

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fleetbase/core-api",
3-
"version": "1.6.36",
3+
"version": "1.6.37",
44
"description": "Core Framework and Resources for Fleetbase API",
55
"keywords": [
66
"fleetbase",

src/Models/Model.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Fleetbase\Models;
44

5-
use Fleetbase\Scopes\CompanyScope;
65
use Fleetbase\Traits\ClearsHttpCache;
76
use Fleetbase\Traits\Expandable;
87
use Fleetbase\Traits\Filterable;
@@ -66,27 +65,6 @@ public function __construct(array $attributes = [])
6665
*/
6766
public $incrementing = false;
6867

69-
/**
70-
* Boot the model and register global scopes.
71-
*
72-
* The CompanyScope is registered here so that every subclass automatically
73-
* inherits tenant isolation on all Eloquent queries. The scope is
74-
* self-guarding: it only activates when a company UUID is present in the
75-
* session and the model's table has a `company_uuid` column, so models
76-
* without that column (User, Company, Setting, etc.) are unaffected.
77-
*
78-
* To bypass the scope for a specific query (e.g. super-admin tooling):
79-
* Model::withoutCompanyScope()->where(...)->get();
80-
*
81-
* @return void
82-
*/
83-
protected static function boot()
84-
{
85-
parent::boot();
86-
87-
static::addGlobalScope(new CompanyScope());
88-
}
89-
9068
/**
9169
* Determines if model is searchable.
9270
*

0 commit comments

Comments
 (0)