Skip to content

Instantly share code, notes, and snippets.

@tournasdim
Created June 24, 2013 19:30
Show Gist options
  • Save tournasdim/5852790 to your computer and use it in GitHub Desktop.
Save tournasdim/5852790 to your computer and use it in GitHub Desktop.
A skeleton of a Laravel 4 Restfull Controller (not namespaced)
<?php
class TestController extends BaseController {
/**
* Setup the root action of this controller.
*
* @return void
*/
public function getIndex()
{
return "hello from getIndex action " ;
}
/**
* Setup the structure for a POST request.
*
* @return void
*/
public function postIndex()
{
return "hello from postIndex action " ;
}
/**
* Setup the structure for another get-action .
*
* @return void
*/
public function getDimas()
{
return "hello from getDimas action " ;
}
/**
* Setup a "Action not found" .
*
* @return void
*/
public function missingMethod($parameters)
{
return "Sorry this is not applicable" ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment