Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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.
    Tim Joosten
    @Tjoosten
    anyone here
    Ruel Luna
    @ruelluna
    Hi All, I am having an error "Call to a member function withCollection() on null" .
    Mark Jayson Fuentes
    @awkwardusername
    @ruelluna uhm, code?
    Ruel Luna
    @ruelluna
    @awkwardusername this is when I call return $this->response->withCollection($users, new UserTransformer());.. Dug in and it seemed to be that the EllipseSynergie Response Class isn't automcatically called so it throws a on null on withCollection method.. Solved it by using that class, injecting through the constructor and assigning $this->response = $response;
    Giammarco R. Casanova
    @grcasanova
    Hello
    anyone here?
    Mark Jayson Fuentes
    @awkwardusername
    @grcasanova what's up.
    Galironfydar
    @Galironfydar
    Hello could someone please tell me if this package supports 5.1?
    Nevermind, I realised I was pulling down the wrong version
    Ben Hamment
    @Otterpocket
    Everything is working just great until I tried to do a post/put request on an action extending ApiGuardController, the token is set and valid as it works with the "get" request, but I get the following Laravel error with post/put:
    blob
    How can I solve this?
    Ben Hamment
    @Otterpocket
    done it :D
    Marin Petkov
    @mpetkov
    sorry to jump in here, but I was wondering if there is a middleware version of this plugin. I just thought that extending a controller for auth is what we did in laravel 4 but in 5 it got moved to middleware
    npaolita
    @npaolita
    hi , i have a big problem, when i make a post request a get a problem with the tokenMismAtchException but when in remove VerifyCrsfToken in kernel , it is ok but i know that this is not a good idea
    how can i fix this pls?
    lgmjalindahl
    @lgmjalindahl
    On laravel 4.2, I'm getting: Class 'Chrisbjr\ApiGuard\ApiGuardController' not found when I have 'use Chrisbjr\ApiGuard\ApiGuardController;' in my controller.
    @chrisbjr any ideas?
    and the line has been added to the app.php
    lgmjalindahl
    @lgmjalindahl
    Fixed it. Your documentation is incorrect. The line should be: "use Chrisbjr\ApiGuard\Controllers\ApiGuardController;"