Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/core-api",
"version": "1.6.36",
"version": "1.6.37",
"description": "Core Framework and Resources for Fleetbase API",
"keywords": [
"fleetbase",
Expand Down
22 changes: 0 additions & 22 deletions src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Fleetbase\Models;

use Fleetbase\Scopes\CompanyScope;
use Fleetbase\Traits\ClearsHttpCache;
use Fleetbase\Traits\Expandable;
use Fleetbase\Traits\Filterable;
Expand Down Expand Up @@ -66,27 +65,6 @@ public function __construct(array $attributes = [])
*/
public $incrementing = false;

/**
* Boot the model and register global scopes.
*
* The CompanyScope is registered here so that every subclass automatically
* inherits tenant isolation on all Eloquent queries. The scope is
* self-guarding: it only activates when a company UUID is present in the
* session and the model's table has a `company_uuid` column, so models
* without that column (User, Company, Setting, etc.) are unaffected.
*
* To bypass the scope for a specific query (e.g. super-admin tooling):
* Model::withoutCompanyScope()->where(...)->get();
*
* @return void
*/
protected static function boot()
{
parent::boot();

static::addGlobalScope(new CompanyScope());
}

/**
* Determines if model is searchable.
*
Expand Down