mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 19:14:45 +02:00
Don’t need these anymore
This commit is contained in:
parent
41f35d6956
commit
a507434422
@ -8,7 +8,6 @@ use Illuminate\Notifications\Notifiable;
|
|||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
@ -105,7 +104,6 @@ use App\Exceptions\Http\Server\ServerStateConflictException;
|
|||||||
*/
|
*/
|
||||||
class Server extends Model
|
class Server extends Model
|
||||||
{
|
{
|
||||||
use BelongsToThrough;
|
|
||||||
use Notifiable;
|
use Notifiable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Container\Container;
|
use Illuminate\Container\Container;
|
||||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use App\Contracts\Extensions\HashidsInterface;
|
use App\Contracts\Extensions\HashidsInterface;
|
||||||
|
|
||||||
@ -24,8 +24,6 @@ use App\Contracts\Extensions\HashidsInterface;
|
|||||||
*/
|
*/
|
||||||
class Task extends Model
|
class Task extends Model
|
||||||
{
|
{
|
||||||
use BelongsToThrough;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource name for this model when it is transformed into an
|
* The resource name for this model when it is transformed into an
|
||||||
* API representation using fractal.
|
* API representation using fractal.
|
||||||
@ -117,8 +115,15 @@ class Task extends Model
|
|||||||
/**
|
/**
|
||||||
* Return the server a task is assigned to, acts as a belongsToThrough.
|
* Return the server a task is assigned to, acts as a belongsToThrough.
|
||||||
*/
|
*/
|
||||||
public function server(): \Znck\Eloquent\Relations\BelongsToThrough
|
public function server(): HasOneThrough
|
||||||
{
|
{
|
||||||
return $this->belongsToThrough(Server::class, Schedule::class);
|
return $this->hasOneThrough(
|
||||||
|
Server::class,
|
||||||
|
Schedule::class,
|
||||||
|
'id', // schedules.id
|
||||||
|
'id', // servers.id
|
||||||
|
'schedule_id', // tasks.schedule_id
|
||||||
|
'server_id' // schedules.server_id
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user