Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Chris Bautista
    @chrisbjr
    hi guys, currently working on better L5 support. Was thinking of doing a complete rewrite for this and make use of middlewares
    aforarup
    @aforarup
    Thanks guys. Much appreciated. I will try stick with the master branch as @chrisbjr cited
    Christophor Wilson
    @CSWilson
    L5 support would be awesome, thanks for working on this @chrisbjr you are a ROCKSTAR!
    Youssef Gaber
    @Gabrola
    @chrisbjr I was working on a conversion to L5 and all that is needed left is to move the logic from ApiGuardController to ApiGuardMiddleware
    Checkout my fork here https://github.com/Gabrola/api-guard
    Youssef Gaber
    @Gabrola
    @chrisbjr I've actually just completed it myself. I've submitted a pull request. It's fully psr-4 and working with L5.
    Nidhal Satouri
    @Nidhalios
    @Gabrola how can I use your L5 version of api-guard ? I tried to install it by pointing to your forked repository in the composer.json
    "repositories": [ { "type": "vcs", "url": "https://github.com/Gabrola/api-guard" }], "require": { "chrisbjr/api-guard": "0.*" }
    It didn't work, it's always pointing to the @chrisbjr original repository.
    Youssef Gaber
    @Gabrola
    @Nidhalios your require should look like this "require": { "chrisbjr/api-guard": "dev-master" }
    Nidhal Satouri
    @Nidhalios
    @Gabrola Thx it worked !
    Chris Bautista
    @chrisbjr
    hi guys - finally done with L5 support. use v2.0.*
    David D.
    @ddimaria
    Is anybody having issues with L5 using api-guard 2.0?
    I'm not getting errors when sending an API request without a key
    Chris Bautista
    @chrisbjr
    Hi @ddimaria what kind of error are you getting?
    Oops read wrong. Check that you did not override the constructor method
    Jonathan Gravois
    @jongravois
    I read in the README that each user has his/her own API key (php artisan api-key:generate --user-id=1). So artisan can generate a key for all existing users but what should be done to account for new users? I am thinking that a command should be bound to the App\Users and a new key generated "on the fly" as a user is created. Is this correct or is there a better way? Thanks!
    Chris Bautista
    @chrisbjr
    @jongravois yes, you can create API keys for new users on the fly. it is totally acceptable.
    David D.
    @ddimaria
    Thanks @chrisbjr! My base controller had a constructor wasn't invoking the parent's constructor: adding "parent::__construct();" did the trick!
    Jonathan Gravois
    @jongravois
    anyone happen to have a working Laravel 5 application? I am having trouble getting it to work
    David D.
    @ddimaria
    I have one...what's wrong?
    Jonathan Gravois
    @jongravois
    Every route gives me a "Trying to get property of non-object" error
    I'm looking for a barebones starter application to try to build on because I started with an app that had jwt-auth and laravel-fractal (albeit not working) which I removed and replaced with api-guard and now it is error prone.
    Jonathan Gravois
    @jongravois
    Since I have been having issues, I rolled back the app to a point before I tried anything with api-guard. Now I am trying to get api-guard working in a test app first so I created a fresh install of Laravel 5 and modified the users migration to mirror the app I am trying to add api-guard into. I followed the README religiously and reached the "Generating your first API key" section without issue. However, when I run php artisan api-key:generate --user-id=1, i get "[Error Exception]: Trying to get property of non-object." How should I continue?
    I can run php artisan api-key:generate and it successfully created a record in my api_keys table (of course, the user_id field is 0)
    Chris Bautista
    @chrisbjr
    Can yoi post the whole error?
    @jongravois
    Jonathan Gravois
    @jongravois

    api [master] php artisan api-key:generate --user-id=1

    [ErrorException]
    Trying to get property of non-object

    ☁ api [master]

    Not much there, I'm afraid
    Jonathan Gravois
    @jongravois
    @chrisbjr, can I suggest that you remove the '4' from your description 'A simple way of authenticating your RESTful APIs with API keys using Laravel 4' since your package now services Laravel 5 as well and the 'Laravel 4' may deter adoption by users stumbling on your package via a search engine?
    Christophor Wilson
    @CSWilson
    Does this package allow for cross domain access to the API? I want to connect to my api.maindomain.com from www.maindomain.com or any other domain for that matter.
    Chris Bautista
    @chrisbjr
    hi @jongravois will definitely remove "Laravel 4" and use "5" instead.
    This message was deleted
    hi @CSWilson it works cross domain - that is the intention
    Sotiris Katsaniotis
    @Sotiris-k
    Hello, I am using the latest version for L4.2 and I can't seem to be able to access the user instance. I can't use ApiKey::user() statically because it's not static. What am I doing wrong?
    To be clear I try to access it in a method in a controller which extends ApiGuardController.
    Btw I also had the same problem as jongravois from above. I didn't find a solution for that either.
    Jonathan Gravois
    @jongravois
    @chrisbjr, beside the issue of being unable to generate user keys from Artisan, I am wondering if your package can be used with the new Lumen.
    Sotiris Katsaniotis
    @Sotiris-k
    I believe Lumen is a deliberately stripped down version of Laravel and does not support packages as Laravel does. So while not being the person responsible to answer this, my guess is no.
    Jonathan Gravois
    @jongravois
    @Sotiris-k, since Lumen is the Laravel 'go-to' for quick APIs (like Node.js), that is unfortunate. Api-guard would be a perfect complement for Lumen.
    Chris Bautista
    @chrisbjr
    @jongravois pull request https://github.com/chrisbjr/api-guard/pull/42 fixes your issue
    Chris Bautista
    @chrisbjr

    @Sotiris-k are you using v1.0? if so, you can easily access your user object using

    $user = $this->apiKey->user; inside your ApiGuardController

    just heard about lumen as well and wondered about making packages for it
    will look into it
    Jonathan Gravois
    @jongravois
    I am git-stupid so if I want to get pull #42, can I just do a composer update?
    Mark Jayson Fuentes
    @awkwardusername
    @jongravois PR was merged.
    tag was 2.1.1 so composer update would do
    khanna91
    @khanna91
    Hi, I was using ApiGuard in L5 it was working, but not any more. Its not throwing error if i dont pass any key, I have checked the documentation. Couldn't figure out. Any Help?
    Chris Bautista
    @chrisbjr
    hi @khanna91 did you override the __construct() method of your controller?
    Chris Bautista
    @chrisbjr
    @khanna91 if you did override it, make sure to include parent::__construct();
    khanna91
    @khanna91
    @chrisbjr : thanks...it worked
    khanna91
    @khanna91
    Api Guard is working perfectly fine for my get request but its throwing error in post request? anyone can help?
    khanna91
    @khanna91
    Its sorted now, it was my oversight. API guard was working smoothly.