kawax/laravel-google-sheets

View on GitHub
src/Traits/GoogleSheets.php

Summary

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

namespace Revolution\Google\Sheets\Traits;

use Illuminate\Container\Container;
use Revolution\Google\Sheets\Contracts\Factory;

/**
 * use at User model.
 */
trait GoogleSheets
{
    public function sheets(): Factory
    {
        $token = $this->sheetsAccessToken();

        return Container::getInstance()->make(Factory::class)->setAccessToken($token);
    }

    /**
     * Get the Access Token.
     *
     * @return string|array
     */
    abstract protected function sheetsAccessToken();
}