Giter Club home page Giter Club logo

laravel-api's People

Contributors

dependabot[bot] avatar joselfonseca avatar juandmegon avatar kslimani avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-api's Issues

Upgrade to laravel 6

Hello there! Make sure you include this checklist in the PR

  • Update to Laravel 6
  • Update Dingo and all of the dependencies
  • Update to Ignition instead of woops
  • Make sure Tests are good
  • Update Travis to test in minimum required PHP version (7.2 I believe)
  • Update config files
  • Update directory structure if needed
  • Update base models if needed

PUT /me

PATCH and PUT endpoints to update the logged in user information

Help, I do not work the routes

Hello, download and install the repository step by step and did not work the calls oauth2 of passport. The tests I did with postman tool

regards.

Is it possible to register without login

I am going to use this as a back-end of a spa (front-end will be react).
so I need to login, registration forget password and reset password script.
any good idea?

Table should not be migrate

In Connection.php line 664:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. (SQL: insert into oauth_clients (user_id, name, secret, redirect, personal_access_client, password_client, revok ed, updated_at, created_at) values (, Laravel API Personal Access Client, nBN4Cssau7Xbbe6bDJVbqpN50LrooVB9OdHWB8dn, http://localhost, 1, 0, 0, 2018-08-24 11:15:44, 2018-08-24 11:15:44))

In Connector.php line 68:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known.

In Connector.php line 68:

PDO::__construct(): php_network_getaddresses: getaddrinfo failed: No such host is known.

update npm packages

In order to make it work in a completely new project I had to change
in package.json :
node_modules/cross-env/bin/cross-env.js
To -> node_modules/cross-env/dist/bin/cross-env.js
and update laravel-mix package using "laravel-mix": "0.*",
just to let you know and check if it was a global issue or just mine

Add PHP 7.0 Constraint in composer.json

When try to Php artisan app:install
unable to figure it out the problem

PHP Parse error: parse error, expecting ';'' or '{'' in /Library/WebServer/Documents/new-api/app/Services/Users/UsersService.php on line 76

[Symfony\Component\Debug\Exception\FatalErrorException]
parse error, expecting ';'' or '{''

How can I login using api

I am going to get an authentication token on postman using username and password
But I can't.
image
image
Please help me

Pagination link is missing some parameters

In the "index" methods of controllers, i see that the limit query parameter is handled to modify the default pagination. But i see that the appends() paginator method is not used to pass at least the limit parameter so it is missing in the generated link in response pagination metadata.

Maybe add something like ->appends($request->only('limit')) (and let developer decide if it allow more ? dunno if $request->all() may be a security issue here).

@joselfonseca what is your opinion on this ?

ParseError: syntax error when running through localhost xampp

Showing the following error while trying to get users list,

ParseError: syntax error, unexpected 'Parser' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in file E:\xampp\htdocs\new-api\vendor\lcobucci\jwt\src\Configuration.php on line 22

#0 E:\xampp\htdocs\new-api\vendor\composer\ClassLoader.php(322): Composer\Autoload\includeFile('E:\xampp\htdocs...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Lcobucci\JWT\Co...')
#2 E:\xampp\htdocs\new-api\vendor\league\oauth2-server\src\AuthorizationValidators\BearerTokenValidator.php(74): spl_autoload_call('Lcobucci\JWT\Co...')
#3 E:\xampp\htdocs\new-api\vendor\league\oauth2-server\src\AuthorizationValidators\BearerTokenValidator.php(66): League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator->initJwtConfiguration()
#4 E:\xampp\htdocs\new-api\vendor\league\oauth2-server\src\ResourceServer.php(67): League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator->setPublicKey(Object(League\OAuth2\Server\CryptKey))
#5 E:\xampp\htdocs\new-api\vendor\league\oauth2-server\src\ResourceServer.php(84): League\OAuth2\Server\ResourceServer->getAuthorizationValidator()
#6 E:\xampp\htdocs\new-api\vendor\laravel\passport\src\Guards\TokenGuard.php(204): League\OAuth2\Server\ResourceServer->validateAuthenticatedRequest(Object(Nyholm\Psr7\ServerRequest))
#7 E:\xampp\htdocs\new-api\vendor\laravel\passport\src\Guards\TokenGuard.php(147): Laravel\Passport\Guards\TokenGuard->getPsrRequestViaBearerToken(Object(Illuminate\Http\Request))
#8 E:\xampp\htdocs\new-api\vendor\laravel\passport\src\Guards\TokenGuard.php(110): Laravel\Passport\Guards\TokenGuard->authenticateViaBearerToken(Object(Illuminate\Http\Request))
#9 E:\xampp\htdocs\new-api\vendor\laravel\passport\src\PassportServiceProvider.php(308): Laravel\Passport\Guards\TokenGuard->user(Object(Illuminate\Http\Request))
#10 [internal function]: Laravel\Passport\PassportServiceProvider->Laravel\Passport{closure}(Object(Illuminate\Http\Request), NULL)
#11 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Auth\RequestGuard.php(58): call_user_func(Object(Closure), Object(Illuminate\Http\Request), NULL)
#12 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Auth\GuardHelpers.php(60): Illuminate\Auth\RequestGuard->user()
#13 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Auth\Middleware\Authenticate.php(63): Illuminate\Auth\RequestGuard->check()
#14 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Auth\Middleware\Authenticate.php(42): Illuminate\Auth\Middleware\Authenticate->authenticate(Object(Illuminate\Http\Request), Array)
#15 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Auth\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure), 'api')
#16 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#17 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Routing\Router.php(694): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#18 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Routing\Router.php(669): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#19 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Routing\Router.php(635): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#20 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Routing\Router.php(624): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#21 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(166): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#22 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#23 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#24 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#26 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#28 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#30 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 E:\xampp\htdocs\new-api\vendor\fruitcake\laravel-cors\src\HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#32 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 E:\xampp\htdocs\new-api\vendor\fideloper\proxy\src\TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#34 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#36 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#37 E:\xampp\htdocs\new-api\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#38 E:\xampp\htdocs\new-api\public\index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#39 {main}

Feat request : upgrade Laravel passport to version 3.0.0

I think it would be nice to upgrade laravel/passport to ^3.0 which will also upgrade league/oauth2-server to 6.0.0.

I locally upgraded and run tests and they all passed.

Motivations is it fixes security issues.

Here the diff for passport from 2.0.11 to 3.0.0. I don't see major breaking changes, except for the key encrypt part fix. (but you may want to double check this).

Here the diff for oauth from 5.1.3 to 6.0.0. Major changes seems to be related to file permissions for key files. (you may also want to double check this).

EDIT: for League oauth server, it seems it require one line to be changed.

Drop Dingo API

Hey @kslimani

What do you think about dropping Dingo as it is not really being maintained? Can you tell me what specific things from Dingo you are tied to or want to still see in the starter kit. Also keep in mind that we now have Resources (https://laravel.com/docs/5.5/eloquent-resources) in Laravel so we could drop Fractal as well.

Let me know what you think.

Reset password Flow + tests

Need an endpoint to let the users update passwords. From an admin and user point of view. Don't want to just update the database record in a PUT or PATCH endpoint along with the user's information.

Openapi3 docs update

What package can I use to update the existing api documentation after making changes?
Thank

PUT me/password

Endpoint to allow the logged in user with the token to update the password. This will accept the following data

PUT /me/password
Authorization: Bearer TOKEN-HERE

{
    "old_password": "old",
    "password": "newPassword"
    "password_confirmation": "newPassword"
}

Old password will help us verify the user is the account owner.

postman return error on create new User

on creating a new user with the role return 500 Internal Server Error with
"message": "Return value of App\Entities\User::getStoredRole() must implement interface Spatie\Permission\Contracts\Role, null returned",
how to solve this issue

GET /me

Me endpoint to get the logged in user profile.

Some issues for composer

install project by composer facing some problem .and missing doc........
1.app:install not run . error bellow

public function setTransformer() :TransformerAbstract
    {
        return app(UserTransformer::class);
    }
  1. vendor/bin/phpunit not run < problem : $this->app->instance(ExceptionHandler::class, new class extends Handler {>
  2. don't run php artisan route:list <oauth2 encryption key issue>

your project have vue.js for need

  • npm install

API usage

Thanks for creating a great stuff.
After following all steps, I could run 127.0.0.1:8000 and API explorer screen.
I also created the passport client called 'admin'.
What should I do next?
I get Unauthorized bugs when I run http://127.0.0.1:8000/api/users

Bug with HasRolesUuid and HasPermissionsUuid

There is an issue i missed when i proposed to upgrade laravel-permission to 2.4 : role and permissions are retrieved from database by name but using also guard name. (the logic is in the Spatie Role and Permission findByName methods).

Result is, for example, when using $user->hasRole('role-name'), it request from database by name or uuid, but not guard name : this is an issue when using multiple guards.

I don't know yet how to fix this. (we could add guard name in the where condition in traits, but i dunno if it is the best way as it may be problematic to maintain).

Maybe simply drop support for checking if a user has role or permission by uuid could be a solution for fix this issue ? In fact, is checking a role by uuid instead of name usefull ?

where is the usage documentation ?

i installed it
and can generate access token as password guard
put it give me 401 Unauthenticated when using it in postman

my post like

GET /api/users HTTP/1.1
Host: pathfinder.local
Accept: application/vnd.api.v1+json
Content-Type: application/json
Authorization: Beare eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImU4MjhlYmY2YTIxYWQzODMzMGJiOWEwN2VkNTgzNWE5ZGEzMjgzNmI0MTdhOTM0ODBkNzYzMGRlMzY0NGZjOTgxZmEyMDU3N2M3MTdjNmQyIn0.eyJhdWQiOiI3IiwianRpIjoiZTgyOGViZjZhMjFhZDM4MzMwYmI5YTA3ZWQ1ODM1YTlkYTMyODM2YjQxN2E5MzQ4MGQ3NjMwZGUzNjQ0ZmM5ODFmYTIwNTc3YzcxN2M2ZDIiLCJpYXQiOjE0OTk4MjQ3MjksIm5iZiI6MTQ5OTgyNDcyOSwiZXhwIjoxNDk5ODYwNzI4LCJzdWIiOiIxIiwic2NvcGVzIjpbIioiXX0.DiHMB0t84W12kJ4TDg_osubovyDNH5UNUR5Lc2EPfy77z75WMRQAM9y_qnQ3GXneaFdj6u4BHemdUD2KOTE_ctT6eztCZ7gRLCLT0xNnwZxzT3Hn-gjf0K5-S0BkwEaMEQWykMEpi2joKu8k1pV5Wr2ahCWfLA9XjSUycFjWbYV9CJvQC6eype0d6QCKwmzfz-fb7j8WcctoxO-d041AJxRvYPFXd1SPtW8TLcy3DrJfGYDqmy-BRg5o7Jway1wbyAnvk4pRRanSwjNCCq14wiO_hdfsPEL9qCY57mzwhyRt3nRJyoX0nAxpKkrz4ogXDH0v1Smmch5gVSP0xmspFnOgtT1wAjJNukC68aEUybAcvpvPyZc0sg0tAUX8L9o1h-w-8gQodYaoyxB9EDMnjBC-cEpk9Kbpy_2DMy0o8OBEKcD1LKOQS1Tsw7403_XEOjjjnEcFDkgEoJeM7ocrS0Qnka8Ui8wibCM_jTDeqLTctD1VC3Gtu7iRZWOmPvY_V-LMwLGgd7T_rBLAugKha3NACgRQXIH2uuqpD_eysqab5aOiJxgG04O4n4q6F9i7XVZD1JnLir_gg6xY5Qs2FrS_CrEZYMUWVIbTumyi0MGUcZz2sqXgvfgEdzYGkQd0G0RmRbM7HTZOnME61G4oEKXf5yDj69YWLPVeukuQN34
Cache-Control: no-cache
Postman-Token: 26df83db-e57b-9853-f8b9-6c9d04f8d5cc

Invalid grant response

Showing this response, pls tell me what to do

{
"error": "invalid_grant",
"error_description": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.",
"hint": "",
"message": "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
}

small typo in roles controller

I think there is a small typo here (doesn't should be $role instead of $user ?) - the code is working, it is only variable name. (not sure if it worth a PR ๐Ÿ˜ธ)

Invalid client id

Showing this response,
{
"error": "invalid_client",
"error_description": "Client authentication failed",
"message": "Client authentication failed"
}

How can I find my client id

Error while running app:install command.

I get this error while running the app:install command.

Installing the app

[Symfony\Component\Debug\Exception\FatalErrorException]
syntax error, unexpected ':', expecting ';' or '{'

Hard to tell where the problem is. Help?

Render File endpoint

Having the ability to upload a file in the API, we also want a way to render a file in the API.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.