1.5.1 • Published 3 years ago

ra-laravel-client v1.5.1

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

ra-laravel-client

A laravel-focused JSONAPI dataprovider for react-admin. This package is still in development. Currently only supports:

  • getList
  • getMany
  • getManyReference
  • getOne
  • create
  • update
  • delete
  • get: Custom wrapper for axios.get() method
  • post: Custom wrapper for axios.post() method

Usage

  1. Install the package npm i -D ra-laravel-client.
  2. Import and set the base url, and pass it as the dataprovider for react-admin.
//in app.js
import React from "react";
import { Admin, Resource } from "react-admin";
import apiClient from "ra-laravel-client";

const dataProvider = apiClient('http://dev.project.loc/api');

const App = () => (
  <Admin dashboard={Dashboard} dataProvider={dataProvider}>
    ...
  </Admin>
);

export default App;

API

  apiClient(api, customConfigs, tokenName);
  • api: a valid API route REQUIRED.
  • customConfigs: an object of custom axios configs.
  • tokenName: a valid token name used when retrieving a Bearer token from localStorage.

Other custom configs

  • "offsetPageNum": number an offset for page counter

Credits

I must give a huge thanks to @henvo. I literally copy-pasted his original repo and adapted to my own codebase.

1.5.1

3 years ago

1.5.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.2.5

3 years ago

1.3.3

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago