Skip to content

Sometimes you want to use Filament Tables, but without dealing with a database table.

License

Notifications You must be signed in to change notification settings

leandrocfe/filament-tables-json-data-source

Repository files navigation

How to consume an external API with Filament Tables

Sometimes you want to use Filament Tables, but without dealing with a database table. This example will allow you to determine the rows for the model getting data from an external source (JSON API).

Data reference: https://dummyjson.com/products

screenshot

Installation

Clone the repository:

git clone https://github.com/leandrocfe/filament-tables-json-data-source.git

Switch to the repo folder:

cd filament-tables-json-data-source

Create a new MySQL database called filament_tables_json_data_source. Copy the example env file and set the database connection:

cp .env.example .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=filament_tables_json_data_source
DB_USERNAME=YOUR_USERNAME
DB_PASSWORD=YOUR_PASSWORD

You may run the following commands in your terminal:

composer install
php artisan migrate

You may create a new user account using:

php artisan make:filament-user

Usage

After the project has been built, start Laravel's local development server using the Laravel's Artisan CLI serve command:

php artisan serve

Once you have started the Artisan development server, your application will be accessible in your web browser at http://localhost:8000/admin.

Visit your Product Resource at /admin/products to try it! Hope you enjoy!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Sometimes you want to use Filament Tables, but without dealing with a database table.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages