Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Robert Mennell
    so is this thing ever going to come to Lumen? I've been looking at the overhead between the two and it looks like a Lumen compatible version of this would be exactly what most API developers would want.
    how do i add a new filter which will require the user object.
    Robert Mennell
    in what context? Are you associating your apikeys with users?
    Robert Mennell
    @tft92 have you looked at this yet? https://github.com/chrisbjr/api-guard/tree/v0.7#accessing-the-user-instance-and-stateless-authentication It shows how to create an apiKey without using the route which should give you some ideas about how to create on when someone logs in, or gets created.
    @gnguyo if you include the apikey model, you can use $this->apiKey->user to retrieve the related user model
    Robert Mennell
    @chrisbjr Love your apiKey class, and I had one quick question about deauthentication. Is there a way I could set an apiKey to something that when it was accessed with this special key, it just returns an error so I don't delete the apiKey entry, but instead just have to generate a new one for them upon login? Or am I over thinking it and I should just set it to a string that I look for specifically to disallow access if the key is such?
    or can I do this with soft deletes?
    Karmendra Suthar
    @chrisbjr Really useful library. I have been working on it for long now. Definitely there is no option to generate a key and store against a user when a new user is created. But in my Controller I built a little function to do so, and it works like a charm. Thanks.
    Karmendra Suthar
    Another thing is, to make sure the apikey that is used, is for the user_id it is generated for, user_id is a required post field. I made it work by modifying ApiGuardController's before filter with somthing very similar to keyAuthentication piece of code. The problem is it is in ApiGuardController, I wan it to be in a place where even if I update the api-guard package, my changes are not overwritten. I thought I will create my own ApiGuardController extending Chrisbjr\ApiGuard\Http\ControllersApiGuardController and override the big constructor where most of the code is copy, but as a second thought can I somehow place this in a filter (I am yet to learn about beforeFilter and afterFilter). What should I do extend ApiGuardController or explore Filters? Any help appreciated.
    While installing the api-guard i got the above errors
    Karmendra Suthar
    you are trying to install api-gaurd v0.1 on laravel 5 or above, I believe, thus the error. if you are using Larvel 5+ in your compoer use version 2.0+ of apigaurd "chrisbjr/api-guard": "~2.0",
    thank you Karmendra, that worked.
    Can i customize the error response sent by the api-guard ?
    Stephan Galea
    hi all
    Hey, as asked here before will a lumen version be available ? At the moment I'm building some APIs and it would be great to use the api-guard with lumen
    David D.
    Hi, I just upgraded to L5.2 and pulled the latest apiguard from dev-master. I'm getting this error: Class apiguard does not exist. Anyone else getting this?
    Sergei Lemnev
    @ddimaria +1 dev-master NOT worked with L5.2 and "stable" 3.0.3 not worked :(
    Sergei Lemnev
    For 3.0.3 I add field protected $apiMethods = []; in all controllers extended ApiGuardController and now all working with laravel 5.2

    Hello there,
    My application is build with laravel 5.0.33,
    I did 'composer require chrisbjr/api-guard' and it install with dependencies,

    When I add 'Chrisbjr\ApiGuard\Providers\ApiGuardServiceProvider::class,' to service provider it throws below exception,

    unknown service provider Chrisbjr\ApiGuard\Providers\ApiGuardServiceProvider::class.

    Astrit Zeqiri

    When i make a request to my contoller:
    i get this:

    Argument 1 passed to Chrisbjr\ApiGuard\ApiGuardAuth::__construct() must be an instance of Chrisbjr\ApiGuard\Contracts\Providers\Auth, null given, called in E:\xampp\xampp\htdocs\2016\api\vendor\chrisbjr\api-guard\src\Providers\ApiGuardServiceProvider.php on line 49 and defined

    P.S. I am using laravel 5.2

    Robert Mennell
    This message was deleted
    Petyo Tsonev
    Hello :) You can use petyots/api-guard repo it supports Laravel 5.3.x
    Keannu Zeigfeld
    Hello, How do you make a request with the api key?
    The documentation says curl --header "X-Authorization: 2ed9d72e5596800bf805ca1c735e446df72019ef" http://localhost:8000/api/v1/books
    but i want to access it like locahost/api/{api_key}/books
    Petyo Tsonev
    Then make a middleware
    or group the routes with this segment
    Chris Bautista
    Hi all - v4.0.0 has been tagged - this is a complete rewrite and will only work with Laravel 5.3 and 5.4. Thanks
    Hi there
    the readme tells about an api_logs table, but i cant find it anywhere in the code / also not in other branches
    also i was wondering how you can submit multiple object in the same request. validator does not seem to like it when i submit more then 1
    @chrisbjr still active here?
    Muhammad Junaid Nasir
    ^^ I don't think so. it was incompatible with laravel 5.5, I have submitted a PR. but to continue with my project I will be pushing it to packigst
    hello all
    i installed the the package but when i trying to migrate it tells that nothing to migrate
    i did all the steps even the publish, it is on laravel 5.4

    Are the generated API keys unique? Is there likely to be a situation where users share the same API key?

    I am just from running the database migration and have noticed that there is no unique constraint for the field api_key in api_keys table. Can anyone clarify