chrisbjr / api-guard

A simple way of authenticating your RESTful APIs with API keys using Laravel
MIT License
692 stars 145 forks source link

"chrisbjr/api-guard": "3.0.*" - generate api key from php #145

Open iateadonut opened 7 years ago

iateadonut commented 7 years ago

"chrisbjr/api-guard": "3.0.*" in Laravel 5.3 - is there a way to generate an api key from php?

Tjoosten commented 7 years ago

To generate an API key from within your application, you can use the following method in the ApiKey model:

$apiKey = Chrisbjr\ApiGuard\Models\ApiKey::make();

This is found in the repo readme.

iateadonut commented 7 years ago

On Laravel 5.3.29, I'm getting this error:

$apiKey = Chrisbjr\ApiGuard\Models\ApiKey::make(); BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::make()'