All Projects → Gustavinho → Laravel Views

Gustavinho / Laravel Views

Licence: mit
Laravel package to create beautiful common views like data tables using the TALL stack.

Projects that are alternatives of or similar to Laravel Views

Web Socket
Laravel library for asynchronously serving WebSockets.
Stars: ✭ 225 (+1.81%)
Mutual labels:  laravel, laravel-package
Voyager Frontend
The Missing Front-end for The Missing Laravel Admin 🔥
Stars: ✭ 200 (-9.5%)
Mutual labels:  laravel, laravel-package
Laravel Surveillance
Put malicious users, IP addresses and anonymous browser fingerprints under surveillance, log the URLs they visit and block malicious ones from accessing the Laravel app.
Stars: ✭ 198 (-10.41%)
Mutual labels:  laravel, laravel-package
Clamav Validator
Laravel virus validator based on ClamAV anti-virus scanner
Stars: ✭ 224 (+1.36%)
Mutual labels:  laravel, laravel-package
Sneaker
An easy way to send emails whenever an exception occurs on server.
Stars: ✭ 223 (+0.9%)
Mutual labels:  laravel, laravel-package
Laravel Option Framework
Manage your laravel application's dynamic settings in one place with various supported input types.
Stars: ✭ 194 (-12.22%)
Mutual labels:  laravel, laravel-package
Voyager Hooks
Hooks system integrated into Voyager.
Stars: ✭ 200 (-9.5%)
Mutual labels:  laravel, laravel-package
Laravel Bootstrap Components
Bootstrap components as Laravel components
Stars: ✭ 190 (-14.03%)
Mutual labels:  laravel, laravel-package
Laravel State Machine
Winzou State Machine service provider for Laravel
Stars: ✭ 213 (-3.62%)
Mutual labels:  laravel, laravel-package
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-7.69%)
Mutual labels:  laravel, laravel-package
Laravel Userstamps
Laravel Userstamps provides an Eloquent trait which automatically maintains `created_by` and `updated_by` columns on your model, populated by the currently authenticated user in your application.
Stars: ✭ 193 (-12.67%)
Mutual labels:  laravel, laravel-package
Laravel Terminator
A package to help you clean up your controllers in laravel
Stars: ✭ 217 (-1.81%)
Mutual labels:  laravel, laravel-package
Laravel Castable Data Transfer Object
Automatically cast JSON columns to rich PHP objects in Laravel using Spatie's data-transfer-object class
Stars: ✭ 191 (-13.57%)
Mutual labels:  laravel, laravel-package
Wisteria
Beautiful document tool for your project.
Stars: ✭ 226 (+2.26%)
Mutual labels:  laravel, laravel-package
Laravel Localization Helpers
🎌 Artisan commands to generate and update lang files automatically
Stars: ✭ 190 (-14.03%)
Mutual labels:  laravel, laravel-package
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (-10.41%)
Mutual labels:  laravel, laravel-package
Laravel Adminer
Adminer database manager for Laravel 5+
Stars: ✭ 185 (-16.29%)
Mutual labels:  laravel, laravel-package
Laravel Cross Eloquent Search
Laravel package to search through multiple Eloquent models. Supports sorting, pagination, scoped queries, eager load relationships and searching through single or multiple columns.
Stars: ✭ 189 (-14.48%)
Mutual labels:  laravel, laravel-package
Hooks
Hooks is a extension system for your Laravel application.
Stars: ✭ 202 (-8.6%)
Mutual labels:  laravel, laravel-package
Laravel Comment
Just another comment system for your awesome Laravel project.
Stars: ✭ 217 (-1.81%)
Mutual labels:  laravel, laravel-package

Laravel views

See live example

Laravel package to create beautiful common views like tables using only PHP code, inspired by Laravel Nova, these views are built with Laravel Livewire and styled using Tailwind CSS

Table View example

Version compatibility

Laravel views Livewire Laravel
2.x 2.x 7.x, 8.x
1.x 1.x 5.x, 6.x

Installation and basic usage

Installing laravel views

composer require laravel-views/laravel-views

Publishing assets

php artisan vendor:publish --tag=public --provider='LaravelViews\LaravelViewsServiceProvider' --force

Including assets

Add the following Blade directives in the head tag, and before the end body tag in your template

<html>
<head>
  ...
  @laravelViewsStyles
</head>
<body>
  ...
  @laravelViewsScripts
</body>
</html>

These blade directives are also including Laravel livewire and Tailwindcss styles and scripts, after that you may need to clear the view cache

php artisan view:clear

If you are already using your own Tailwindcss setup you can set laravel-views to not importing Tailwindcss by default. (Importing assets)

First table view

This is a basic usage of a table view, you can read the full table view documentation

Once you have installed the package and included the assets you can start to create a basic table view.

php artisan make:table-view UsersTableView

With this artisan command a UsersTableView.php file will be created inside the app/Http/Livewire directory.

The basic usage needs a data repository (Eloquent query), headers and rows, you can customize the items to be shown, and the headers and data for each row like this example

<?php

namespace App\Http\Livewire;

use LaravelViews\Views\TableView;
use Illuminate\Database\Eloquent\Builder;
use App\User;

class UsersTableView extends TableView
{
    public function repository(): Builder
    {
        return User::query();
    }

    public function headers(): array
    {
        return [
            'Name',
            'Email',
            'Created',
            'Updated'
        ];
    }

    public function row($model)
    {
        return [
            $model->name,
            $model->email,
            $model->created_at,
            $model->updated_at
        ];
    }
}

Rendering the table view

You can render this view in the same way as you would do it for a livewire component (Rendering components). The easiest way to render the view is using the livewire tag syntax:

<livewire:users-table-view />

You could also use the @livewire blade directive.

@livewire('users-table-view')

At this point, you would be able to see a table with some data, the table view doesn't have any styled container or title as the image example, you can render the table view inside any container you want.

In the example above the view is using the User model created by default in every Laravel project, feel free to use any model you have, the method row is receiving a sinlge model object and you can use any property or public method you have difined inside your model.

This is the basic usage of the table view, but you can customize it with more features.

Read the full table view documentation

Advanced usage

Read the advanced laravel-views documentation

Views available

Table view

Dynamic data table with some features like filters, pagination and search input, you can customize the headers, the data to be displayed for each row

Grid view

Dynamic grid view using card data, same as a TableView this view has features like filters, pagination and a search input, you can also customize the card data as you need

List view

Dynamic list view with filters, pagination, search input, and actions by each item, it is useful for small screens, you can also customize the item compoment for each row as you need.

Detail view

Dynamic detail view to render a model attributes list with all the data you need, you can also customize the default component to create complex detail views and execute actions over the model is being used.

Contributing

Check the contribution guide

Roadmap

Laravel Views is still under heavy development so I will be adding more awesome features and views.

Here's the plan for what's coming:

  • New form view
  • New layout view
  • Add tooltips to actions buttons
  • Add a download action
  • Add translations
  • Add links as a UI helpers
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].