8000 GitHub - magiclabs/magic-laravel
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

magiclabs/magic-laravel

Repository files navigation

Magic Laravel SDK

This package provides direct Laravel integration for Magic Admin PHP SDK.

Requirements

Laravel 5.3 or newer.

Installation

Run this command to install via composer.

composer require magiclabs/magic-laravel

Older Laravel Installations

If you are using Laravel 5.5 or newer then skip this part. Otherwise you will need to manually register the service provider and facade alias by going to config/app.php.

Add to the providers array:

MagicLaravel\ServiceProvider::class

Add to the aliases array:

'Magic' => MagicLaravel\Facade::class,

Setup

Publish config file.

php artisan vendor:publish --provider="MagicLaravel\ServiceProvider"

Add MAGIC_SECRET_API_KEY to your .env file by going to the Magic Dashboard.

MAGIC_SECRET_API_KEY=sk_XXXX_XXXXXXXXXXXXXXXX

Usage

For complete documentation see Magic Admin PHP SDK and the Magic docs.

Get instance using the app helper:

$magic = app('MagicLaravel\Magic');

$magic->token->validate('<DID_Token>');

$magic->user->get_metadata_by_token('<DID_Token>');

Or get instance using the facade:

use Magic;

Magic::token()->validate('<DID_Token>');

Magic::user()->get_metadata_by_token('<DID_Token>');

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0