sinemacula/laravel-resource-exporter

View on GitHub
src/Facades/Exporter.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

namespace SineMacula\Exporter\Facades;

use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Http\Resources\Json\ResourceCollection;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Facade;
use SineMacula\Exporter\Contracts\Exporter as ExporterContract;

/**
 * Exporter facade.
 *
 * @method static ExporterContract format(string|null $format)
 * @method static array getConfig()
 * @method static ExporterContract withoutFields(string|array $fields)
 * @method static string exportItem(JsonResource $resource)
 * @method static string exportCollection(ResourceCollection $collection)
 *
 * @see         \SineMacula\Exporter\Exporter
 *
 * @author      Ben Carey <bdmc@sinemacula.co.uk>
 * @copyright   2024 Sine Macula Limited.
 */
class Exporter extends Facade
{
    /**
     * Get the registered name of the component.
     *
     * @return string
     */
    protected static function getFacadeAccessor(): string
    {
        return Config::get('exporter.alias', 'exporter');
    }
}