0.0.4 • Published 4 years ago

vue-table-laravel-component v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
4 years ago

vue-table-laravel-component

GitHub - npm

For this package to work properly, you need to have Ziggy setup in Laravel so the component can read Laravel routes.

This component also uses laravel-vue-pagination to get the pagination feature.

The component can take 3 different props, wich is:

  • dataUrl - Wich takes a URL where the component should get its data from. Example of this would be example.com/api/users - The response from this URL should be be a collection with the pagination method added. Example: return $users = User::select(['id', 'name', 'email', 'created_at'])->paginate(20); - Note: All selected keys will be shown in the table!
  • viewUrlKey - This is the name of the column you want to have the view link attached to. Usually you have a view route in a resource controller in Laravel. Example could be to use the name key to be the link to view the user.
  • viewRouteName - This is the name of the route where you can view a user in this example. This could users.view, all depends on how you have setup your Laravel application.

There is no CSS to this component, but there is a loading-spinner class when the xhr request is loading the data.

This is my first package, so there are probably bugs or some other stuff that could have been done a better way. Have some ideas for future updates like adding classes to the table and such. Maybe even delete buttons, we'll see.

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago