laravel-api-client
v1.0.2
Published
A library for interacting with Laravel APIs in Next.js
Readme
Laravel API Client
A simple client library to interact with Laravel API resources for CRUD operations and authentication.
Installation
- Clone the repository or copy the files.
- Run
npm installto install dependencies.
Usage
Initialization
import LaravelApiClient from './laravel-api-client';
const apiClient = new LaravelApiClient('https://your-laravel-api.com/api', () => localStorage.getItem('auth_token'));
// Example: Fetch all posts
apiClient.get('posts').then(posts => console.log(posts));