mercredi 27 avril 2016

Laravel 5.0: Issue with implicit controller, multi parameters, named routes

I am facing a problem with building a solid routing system in my Laravel App. I need to use Implicit Controller routing, with named routes and multiple parameters. (Because I am part of a big team uses this way everywhere in the system)

My project is about developing Quiz and Questions CRUD for Courses Management Systems. The main used parts are:

Course ->(has) Sections ->(has) Quiz ->(has) Questions

  • I created the index page that lists all of the questions. From the main page we click on button shows a bootstrap modal form to create New Question.

*** The problem is when I submit the form to a Named Route linked to a controller method to store the new question, the store method in the controller is Not called, and instead the Index Named route method is called and executed. (wildcard names problem !!)

This the route file route.php

This is the view that contains the form for adding new question. it's linked to the named route that should call the 'postQuestion' which is responsible for storing new question view filw

this is the controller that contains the method 'postQuestion' which I think should be called when the previous form is submitted controller file

*** To make it short: I am not sure about how to invoke the correct controller's method when we use the implicit controller with named routed and having a multiple parameters url!

Any advise would help



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TfeYKR
via IFTTT

Aucun commentaire:

Enregistrer un commentaire