1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-02-23 10:43:41 +01:00
LinkAce/app/Jobs/SaveLinkToWaybackmachine.php

40 lines
816 B
PHP

<?php
namespace App\Jobs;
use App\Helper\WaybackMachine;
use App\Models\Link;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class SaveLinkToWaybackmachine implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var Link */
protected $link;
/**
* Create a new job instance.
*
* @param Link $link
*/
public function __construct(Link $link)
{
$this->link = $link;
}
/**
* Notify the Wayback Machine about the link
*
* @return void
*/
public function handle(): void
{
WaybackMachine::saveToArchive($this->link->url);
}
}