You can generate a controller by following command.
php artisan next:controller Blog Blog
INFO
Generated controller will be at app/Modules/BlogModule/Http/Controllers/BlogController.php
WARNING
The controller must extend the Next Laravel controller Laranex\NextLaravel\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\NextLaravel\Cores\Controller;
class BlogController extends Controller
{
public function store()
{
return $this->serve(StoreBlogFeature::class);
//OR
return $this->serve(new StoreBlogFeature());
}
}