DocBlock annotations in Laravel 5.1

DocBlock annotations in Laravel

When Laravel 5 was being developed, support for routing and event listeners via DocBlock annotations was originally added. Its syntax was similar to Symfony and Zend.

 

 

Symfony

The syntax for Symfony is as follows:

/**
 * @Route("/accommodations/search")
 * @Method({"GET"})
 */

public function searchAction($id)
{

Zend

The syntax for Zend is as follows:

/**
 * @Route(route="/accommodations/search")
 */

public function searchAction()
{

About the author

Deven Rathore

I'm Deven Rathore, a multidisciplinary & self-taught designer with 3 years of experience. I'm passionate about technology, music, coffee, traveling and everything visually stimulating. Constantly learning and experiencing new things.

Pin It on Pinterest

Shares