Coder Social home page Coder Social logo

laravel-test's Introduction

title
Laravel API Test Task

Test Task: Laravel API for Book Management

Task Description

Create a RESTful API for managing a collection of books. Each book should have a title, author, and publication year. The application should be built using Laravel and follow best practices for API development, validation, and security.

Requirements

1. Setup:

  • Use Laravel to create a new project.
  • Set up a MySQL database to store the book records.
  • Implement migrations for creating the necessary database tables.

2. Book Model:

  • Create a Book model with the following fields: title, author, and publication_year.
  • Implement validation rules for each field (e.g., required, max length, etc.).

3. API Endpoints:

  • Implement the following RESTful API endpoints for books:
    • GET /api/books: Retrieve a list of all books.
    • GET /api/books/{id}: Retrieve details of a specific book.
    • POST /api/books: Create a new book.
    • PUT /api/books/{id}: Update an existing book.
    • DELETE /api/books/{id}: Delete a book.

4. Request and Response Formats:

  • Define appropriate request and response formats using JSON.
  • Handle validation errors and provide meaningful error responses.

5. Validation:

  • Implement validation for incoming requests (e.g., required fields, valid data types).
  • Return appropriate HTTP status codes for successful and unsuccessful requests.

6. Security:

  • Implement API token-based authentication for the API.
  • Use Laravel's built-in features for handling validation errors.

7. Testing:

  • Write a basic test for one of the API endpoints using Laravel's testing tools.

8. Git:

  • Initialize a Git repository for the project.
  • Commit your changes with meaningful commit messages.
  • Push the code to a public repository on GitHub.

Submission

  • Provide a link to the GitHub repository containing your code.
  • Include a README file with instructions on how to set up and test the API.

Evaluation Criteria

Candidates will be evaluated based on:

  • Correct implementation of API endpoints.
  • Proper use of Laravel features for API development.
  • Code readability, structure, and organization.
  • Adherence to coding standards and security practices.
  • Successful completion of the testing requirements.
  • Demonstrated understanding of Laravel concepts and PHP for API development.

laravel-test's People

Contributors

ramyareye avatar

Watchers

 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.