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.




The syntax for Symfony is as follows:

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

public function searchAction($id)


The syntax for Zend is as follows:

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

public function searchAction()


The syntax for Laravel is as follows:

 * @Get("/hotels/search")

public function search()

What type of problem does the DocBlock annotation try to solve though?

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