Skip to content

Commit

Permalink
https://github.com/laravel/framework/issues/42075
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagof committed Apr 21, 2022
1 parent 832d46e commit bfebf88
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Models/Client.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Client extends Model
{
use HasFactory;
use SoftDeletes;
}
24 changes: 24 additions & 0 deletions app/Models/Contract.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Contract extends Model
{
use HasFactory;
use SoftDeletes;

public function relationSelf(): HasMany
{
return $this->hasMany(static::class)->onlyTrashed();
}

public function relationOther(): HasMany
{
return $this->hasMany(Client::class)->onlyTrashed();
}
}

0 comments on commit bfebf88

Please sign in to comment.