GithubHelp home page GithubHelp logo

lara-rest's Introduction

REST API - CRUD

Setup:

1. Clone the repository

git clone https://github.com/Bellov/lara-rest.git

2. Configure MYSQL database

  • Create a database named rest-articles.

3. Run the application

Mac Os, Ubuntu and windows users continue here:

  • Open the console and cd your project root directory
composer install
php artisan key:generate
  • Then open .env and change username and password as per mysql installation.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= rest-articles
DB_USERNAME= Your database username
DB_PASSWORD= Your database password
1. php artisan migrate
2. php artisan db:seed --class=ArticlesTableSeeder
3. php artisan db:seed --class=UserTableSeeder
php artisan serve

You can now access the project at localhost:8000

  • API calls routes
1. GET: http://localhost:8000/rest/article
2. UPDATE: http://localhost:8000/rest/article/1
3. SHOW: http://localhost:8000/rest/article/3
4. DELETE: http://localhost:8000/rest/article/3
5. CREATE: http://localhost:8000/rest/article

For filter records the route is: 
http://localhost:8000/rest/filter?title=test

For paginate records the route is: 
http://localhost:8000/rest/articles?paginate=1

lara-rest's People

Contributors

bellov avatar

Watchers

James Cloos avatar  avatar

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.