#Load model without default relationships

7 messages · Page 1 of 1 (latest)

earnest dirge
#

Is there any way to load a model without its default relationships (protected $with = ['allocation'];)

As even when I select a specific column like Log::info(Server::where('id', $request->user()->id)->get('id')->toArray()); it still includes the default relation:

  0 => 
  array (
    'id' => 59,
    'allocation' => NULL,
  ),
  1 => 
  array (
    'id' => 62,
    'allocation' => NULL,
  ),
  2 => 
  array (
    'id' => 63,
    'allocation' => NULL,
  ),
  3 => 
  array (
    'id' => 64,
    'allocation' => NULL,
  ),
  4 => 
  array (
    'id' => 66,
    'allocation' => NULL,
  ),
)  ```
paper saffron
#

I see that as like global scopes: don’t use them if you don’t want them applied globally.

#

Which means I seldom use them.

earnest dirge
earnest dirge
#

or an other question, is there some easy way to exclude them from the already builded query result?

wise badge