Download the PHP package mtr-design/laravel-logo-fetcher without Composer
On this page you can find all versions of the php package mtr-design/laravel-logo-fetcher. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mtr-design/laravel-logo-fetcher
More information about mtr-design/laravel-logo-fetcher
Files in mtr-design/laravel-logo-fetcher
Package laravel-logo-fetcher
Short Description Fetching companies' logos by their domain names
License MIT
Informations about the package laravel-logo-fetcher
Laravel Logo Fetcher
Installation
Require this package with composer:
Add the ServiceProvider to the providers array in config/app.php
Copy the package config to your local config with the publish command:
You now should have config/logo_fetcher.php file. You can open and tweak the configuration options
Usage
- Resolve the \MTRDesign\LaravelLogoFetcher\LogoFetcher class from the container
- Set a provider using the provider() method
- Call the fetch() method to get the logo
- You can chain with store() to save it using your default storage disk
If you want to directly store the logo:
If you want to just fetch the logo:
One extra example to illustrate the domain() helper and the path property, assuming that you injected the logo fetcher class:
Providers
You can define your own providers - just create a class and implement the MTRDesign\LaravelLogoFetcher\Providers\ProviderContract
Error handling
Different exceptions will be raised if the fetching fails but they all inherit from the \MTRDesign\LaravelLogoFetcher\Exceptions\LogoFetcherException
. All are having human-readable messages and can be safely output to the client. You can find all the exceptions in the \MTRDesign\LaravelLogoFetcher\Exceptions
namespace.