1. Go to this page and download the library: Download deva7mad/lumen-annotations library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
deva7mad / lumen-annotations example snippets
namespace App\Http\Controllers;
use DevA7mad\Annotations\Annotations as Route;
/**
* Class annotation for UserController (belongs to all class methods).
*
* @Route\Controller(prefix="admin")
*/
class UserController
{
/**
* Method annotations for showProfile($id) method.
* @param $id
* @Route\Get("profiles/{id}", as="profiles.show")
* @return mixed
*/
public function showProfile($id)
{
return $id;
}
}
namespace App\Http\Controllers;
use DevA7mad\Annotations\Annotations as Route;
/**
* Class annotations for resource controller CommentController (belongs to all class methods).
*
* @Route\Controller
* @Route\Resource("comments", only={"create", "index", "show"})
* @Route\Middleware("auth")
*/
class CommentController
{
...
}
namespace App\Handlers\Events;
use DevA7mad\Annotations\Annotations\Hears;
/**
* Annotation for event binding.
*
* @Hears("UserWasRegistered")
*/
class SendWelcomeMail
{
...
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.