haoyuqi/download-bing-wallpaper

Download bing wallpaper

Installs: 2 124

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/haoyuqi/download-bing-wallpaper

2.1.1 2022-04-05 02:24 UTC

This package is auto-updated.

Last update: 2025-11-05 10:38:53 UTC


README

Installation

composer require haoyuqi/download-bing-wallpaper

Usage

<?php

namespace App\Http\Controllers;

use Haoyuqi\DownloadBingWallpaper\Contracts\BingWallpaperInterface;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    protected $bingWallpaper;

    public function __construct(BingWallpaperInterface $bingWallpaper)
    {
        $this->bingWallpaper = $bingWallpaper;
    }

    public function index()
    {
        $content = $this->bingWallpaper->download();

        $this->bingWallpaper->save($content, storage_path('bing-wallpaper'), 'bing-wallpaper.png');
    }
}