Coder Social home page Coder Social logo

merlosy / laravel-restful-api-starter Goto Github PK

View Code? Open in Web Editor NEW
67.0 67.0 16.0 747 KB

Build a RESTful API with Laravel and MongoDB

Home Page: http://merlosy.github.io/laravel-restful-api-starter

License: MIT License

PHP 99.15% JavaScript 0.50% ApacheConf 0.35%
laravel restful restful-api starter

laravel-restful-api-starter's People

Contributors

merlosy 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

Watchers

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

laravel-restful-api-starter's Issues

Client documentation

Hello

I got 3 questions/requests:
Can you upload somewhere client [or at least some code how to login/create account etc. with js/jQuery or AngularJS) to test that API?
Can you describe (add some comments to code) why you did something 'this way'?
Can you create 'database migrate'? I would like to test is with SQLite and MySQL.

Thank you for your great example 'how to create restful laravel api'. I hope you will have some time to answer my questions.

Logout & Show method

Hi there,

Great project - I'm new to Laravel so this is a great project to learn from. I am rather confused however how I can call the logout & show method. What should the {users} argument have as a value?

Thanks in advance!

Sam

$user->login() method potentially deletes tokens not owned by the user

in User.php:
If the client request contains a blank 'device_id', 'device_os', this query will delete auth tokens belonging to other users.

 // clear old sessions for any user with: same(device_id, os)
$to_remove = Token::where('device_id', '=', $device_id)
                ->where('device_os', '=', $device_type)
                ->delete();

I propose fixing with:

$to_remove = Token::where('user_id', '=', $this->id)
                        ->where('device_id', '=', $device_id)
                        ->where('device_os', '=', $device_type)
                        ->delete();

Using it with mysql

Hi

Thanks for sharing this code.

I have in mind using it but with mysql. I have everything in place and I've edited database.php to default to mysql. But when I do post to users to create a new one I get:

{"error":{"code":500,"message":"Class 'MongoDate' not found","file":"\/home\/vagrant\/Code\/prueba.com\/vendor\/jenssegers\/mongodb\/src\/Jenssegers\/Mongodb\/Model.php","line":212}}

What am I missing to use this code with just mysql?

Thanks

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.