eduzz/accounts-laravel-adapter

Eduzz Account 与 Laravel Jetstream 集成包。

v1.35 2023-03-09 16:58 UTC

README

用于在 Laravel 应用中利用 Jetstream 使用 Eduzz Account 的模块。

安装

使用 composer 安装包

composer require eduzz/accounts-laravel-adapter

您需要使用以下命令发布配置:

php artisan vendor:publish --tag="adapter-config"

您需要使用以下命令发布和执行迁移:

php artisan vendor:publish --tag="adapter-migrations"
php artisan migrate

这是已发布配置文件的内容

return [

    /**
     * Enable/disable the Eduzz Account button.
     */
    'enabled' => env('EDUZZ_ACCOUNTS_ENABLED', true),

    /**
     * Url to get back the results of the login attempt.
     */
    'callbackUrl' => env('EDUZZ_ACCOUNTS_CALLBACK_URL', '/eduzz/callback/'),

    /**
     * Eduzz credentials of this app.
     */
    'id' => env('EDUZZ_ACCOUNTS_ID'),
    'secret' => env('EDUZZ_ACCOUNTS_SECRET'),

    /**
     * Url to redirect the user after the login.
     */
    'redirect_to' => '/login',

    /**
     * The column name to store the Eduzz Account ID.
     */
    'tableColumn' => 'eduzz_account_id',

    /**
     * Define if the app use Teams.
     */
    'hasTeams' => true,

    /**
     * The app logo to show in the login page.
     */
    'logo' => '',

    /**
     * The background image to show in the login page.
     */
    'backgroundImage' => '',

    /**
     * Define the button color.
     */
    'buttonColor' => '#000',

    /**
     * Set the Eduzz Account Controller class.
     */
    'routeController' => \Eduzz\AccountsLaravelAdapter\AccountsLaravelAdapterController::class,

    /**
     * The Eduzz Account url API.
     */
    'productionApiUrl' => env('EDUZZ_ACCOUNT_API_URL'),
    'testingApiUrl' => env('EDUZZ_ACCOUNT_TESTING_API_URL'),
];

同时,也请导入 app.css 中的按钮样式

@import "/vendor/eduzz/accounts-laravel-adapter/resources/dist/button.css";

可选地,您可以使用以下命令发布视图:

php artisan vendor:publish --tag="adapter-views"

使用方法

在您的 blade 视图中,使用以下方式:

<x-eduzz-account-login-button>Login com Eduzz Account</x-eduzz-account-login-button>

Captura de Tela de Login

测试

composer test

许可证

MIT 许可证 (MIT)。