📕
Sprnva Docs
  • Introduction
  • What's New?
  • Installation
    • Requirements
    • Download Sprnva zip no composer required
    • Install Sprnva Using Composer
    • Setup Config
  • Deployment
  • File Structure
  • Database
    • Select
    • SelectLoop
    • Insert
    • Update
    • Delete
    • Query
    • Seeder
    • Paginate
    • With
    • andFilter
    • withCount
    • get
  • Query Builder
  • Migration
    • INSTANCES
      • NEW
      • RENAMETABLE
      • DROP
      • CHANGE
    • DUMPS
      • dump
      • dump prune
    • MAKE
    • MIGRATE
      • migrate
      • migrate fresh
    • ROLLBACK
  • Routing
    • with parameter
    • multiple parameters
    • with closure
    • group
    • controller grouping
  • Controllers
    • methods
  • Views
    • Passing Parameters
  • Validation
    • validate
      • validation type
  • Authentication
  • Alert Messages
  • Default Helpers
  • CSRF Protection
  • Email
  • Packages
    • Fortify
  • Themes and Templates
Powered by GitBook
On this page
  1. Controllers

methods

Recommended controller Method Name

Verb
URI
Method

GET

/project

index

GET

/project/create

create

POST

/project

store

GET

/project/{project_id}

show

GET

/project/{project_id}/edit

edit

POST

/project/{project_id}

update

POST

/project/{project_id}/delete

destroy

WORKS ON AJAX ONLY AND SOME BROWSERS

PUT/PATCH

/project/{project_id}

update

DELETE

/project/{project_id}

destroy

GET, POST, PUT/PATCH and DELETE (there are others) are a part of the HTTP standard, but you are limited to GET and POST in HTML forms at this time. You can use PUT/PATCH and DELETE in AJAX requests; however, this only works in some browsers.

ALWAYS REMEMBER WHEN ADDING A CLASS, DON'T FORGET TO ADD IT'S NAMESPACE AND RE-INITIALIZE THE CLASS AUTOLOADER USING COMPOSER.

This is how you re-initialize class autoloader using composer.

composer dump-autoload
PreviousControllersNextViews

Last updated 2 years ago