Giter Club home page Giter Club logo

laravel-challenge-route-model-binding's Introduction

Laravel Challenge: Route Model Binding

UPDATE 10:42am UTC: Sorry I will stop reviewing the PRs, there's just too many of them, 50+ PRs in 5 hours! Will shoot a separate video in a few days, discussing the results, and for the correct answer check PRs from 1 to 4.

This is a demo-project which has intentional errors around Routing and Route Model Binding.

Your task is to fix those errors, by submitting a Pull Request.

How to install

  • Clone the repository with git clone
  • Copy .env.example file to .env and edit database credentials there
  • Run composer install (if anyone got problems with composer on windows, try running it like this: composer install --ignore-platform-reqs)
  • Run php artisan key:generate
  • Run php artisan migrate --seed (it has some seeded data for your testing)
  • That's it: launch the main URL.

You should see the list of transactions, something like this:

Homepage

None of those three buttons View/Export/Duplicate will work. This is exactly the task for you.


Rules: How to perform the tasks

I will be expecting a Pull Request to the main branch, containing all fixes with completely working project.

If you don't know how to contribute a PR, here's my video with instructions.

Important: I will NOT merge the Pull Request, only comment on it, whether it's correct or not.

At the time of writing, I'm not sure how many PRs I will be able to review, or maybe the community will help them. At some point, I will probably stop the challenge and stop accepting PRs, providing the correct answer, which may be actually chosen as one of the PRs.

If you have any questions, or suggestions for the future challenges, please open an Issue.

Good luck!


Task 1. View

When you click View, the error should be something like this:

Target class [App\Http\Controllers\Transaction] does not exist.

Expected result, after the fix, is a page with task details:

Transactions show


Task 2. Export

You can perform this task only AFTER you finish the Task 1 above, otherwise you will get the same error as Task 1.

When you click Export, the error should be something like this:

Attempt to read property "name" on null (View: /resources/views/transactions/export.blade.php)

Expected result, after the fix, is a page for checking details for export:

Transactions Export


Task 3. Duplicate by UUID

Duplicate the task should happen with UUID as a URL parameter, it's one of the database fields: transactions.uuid.

When you click Duplicate, you may have two kinds of errors, randomly:

  • Either is would show the incorrect transaction, so data from another transaction
  • Or it would show the page "404 Not Found"

Expected result, after the fix, is a page for checking details for duplication:

Transactions Duplicate

laravel-challenge-route-model-binding's People

Contributors

povilaskorop avatar faycalborsali avatar yazanqwaider 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.