Starting Transfers
Every transfer starts from the Aria2 facade (or the Factory contract). Both HTTP(S) URLs and magnet URIs share the same pending builder.
use Pullr\LaravelAria2\Facades\Aria2; Aria2::url('https://example.com/file.iso') ->dir(storage_path('app/downloads/1')) ->download(); Aria2::magnet('magnet:?xt=urn:btih:...') ->dir(storage_path('app/downloads/2')) ->download();
magnet() is an alias of url(). Use whichever reads more clearly.
Blocking
download() waits until aria2 reports complete, or throws. Run it on a queue worker.
Aria2::url($url) ->dir($directory) ->id($pullId) ->download();
The return value is the last TransferStatus snapshot emitted during the transfer.
Required destination
A destination directory is required. Starting without dir() throws TransferFailedException.
The package creates the directory if it does not exist.