PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

I want to capture data in grid card form instead of table view.

Solved
alikaratekin06

Jun 13th, 2024 07:10 AM

First of all, I'm sorry if Google is doing a rough translation.

What I actually want to do is to pull the data from the database as a card instead of a table and publish it.

I have minimal knowledge on this subject. Can anyone help me? Adsız tasarım.png

What I want to do is to show the data in each row of the table as a card and when we click on it, I want it to go to the view screen.

I thank you very much in advance for the friends who will support me.

bobbyiliev

Jun 13th, 2024 11:01 AM

Best Answer

Hey!

With Voyager you can create your own custom Edit, Add, View views, by default Voyager make use of just one Edit Add View file located in vendors/tcg/voyager/resources/views/bread/edit-add.blade.php.

There is a quick post that goes over this here.

Let say we want to override the Edit Add view for a model called City with table cities (BREAD) we created, then you can follow these steps:

  1. Create a folder called vendor in your views folder
  2. Create a folder called voyager in your vendor folder
  3. Create a folder for that BREAD in our example its cities folder

Or use this command: mkdir -p resources/views/vendor/voyager/cities

  1. Then in that directory, create a new file edit-add.blade.php
  2. Create a new HTML Heading element in edit-add.blade.php saying 'override works'.
  3. Copy the default edit-add.blade.php into the new created `edit-add.blade.php to make editing fast

Your folder structure will look like this Alt Text

This is also applicable to other views also.

Sources:

Overriding BREAD Views

Then you can modify that new bread view and change the HTML so that it does not show the data in a table but instead renders them in a grid view.

Hope that this helps!

- Bobby