Skip to content

marko-php/marko-admin-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marko/admin-api

Admin REST API --- exposes admin sections, menu items, and current user data as JSON endpoints for headless or SPA-based admin clients.

Installation

composer require marko/admin-api

Requires marko/admin and marko/admin-auth.

Quick Example

use Marko\AdminApi\ApiResponse;
use Marko\AdminAuth\Middleware\AdminAuthMiddleware;
use Marko\Routing\Attributes\Get;
use Marko\Routing\Attributes\Middleware;
use Marko\Routing\Http\Response;

#[Middleware(AdminAuthMiddleware::class)]
class OrderApiController
{
    #[Get('/admin/api/v1/orders')]
    public function index(): Response
    {
        return ApiResponse::paginated(
            data: $orders,
            page: 1,
            perPage: 20,
            total: 150,
        );
    }
}

Documentation

Full usage, API reference, and examples: marko/admin-api

About

[READ-ONLY] Admin REST API for Marko Framework. Issues and PRs at https://github.com/marko-php/marko

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages