Move determination of system packet to System::class
This commit is contained in:
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Jobs\AddressPoll;
|
||||
|
||||
class System extends Model
|
||||
@@ -249,6 +250,17 @@ class System extends Model
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the packet that this system uses
|
||||
*
|
||||
* @return Packet
|
||||
*/
|
||||
public function packet(): Packet
|
||||
{
|
||||
return new (collect(Packet::PACKET_TYPES)
|
||||
->get($this->pkt_type ?: config('fido.packet_default')));
|
||||
}
|
||||
|
||||
public function poll(): ?Job
|
||||
{
|
||||
return Job::where('queue',AddressPoll::QUEUE)
|
||||
|
Reference in New Issue
Block a user