You can generate a controller by following command.
php artisan better:controller Blog Blog
INFO
Generated controller will be at app/Modules/BlogModule/Http/Controllers/BlogController.php
WARNING
The controller must extend the Better Laravel controller Laranex\BetterLaravel\Cores\Controller
to work with the serve
method.
All you need to do is call serve
within the controller method.
use App\Modules\BlogModule\Features\StoreBlogFeature;
use Laranex\BetterLaravel\Cores\Controller;
class BlogController extends Controller
{
public function store()
{
return $this->serve(StoreBlogFeature::class);
//OR
return $this->serve(new StoreBlogFeature());
}
}