andach/laravel-view-components

This is my package laravel-view-components

Installs: 693

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/andach/laravel-view-components

v2.0.2 2025-10-14 06:10 UTC

This package is auto-updated.

Last update: 2025-10-14 06:11:22 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is the standard Laravel form components package for Andach Limited. It helps us keep our apps all consistently formatted and branded. It is not likely to be of use to most people in its current state, but has been released open source in the hope that it will help some people learn and understand how to make their own similar packages.

Installation

You can install the package via composer:

composer require andach/laravel-view-components
php artisan view-components:install

Then publish the js with:

php artisan vendor:publish --tag=view-components-assets

And if desired, can publish the config and views with:

php artisan vendor:publish --tag=view-components-config
php artisan vendor:publish --tag=view-components-views

The config file can then be edited to point the views towards your local copy to modify them if needed.

Tailwind

You will need Tailwind and FontAwesome installed in your laravel project:

npm install tailwindcss @tailwindcss/vite @fortawesome/fontawesome-free
npm install 

Also update your resources/css/app.css to include:

@import 'tailwindcss';
@import '@fortawesome/fontawesome-free/css/all.css';

@source '../../vendor/andach/laravel-view-components/src/Components/*.php';
@source '../../vendor/andach/laravel-view-components/resources/views/**/*.blade.php';
@source '../../vendor/andach/laravel-view-components/config/view-components.php';
@source '../../config/view-components.php';

@custom-variant dark (&:where(.dark, .dark *));

And your resources/js/app.js to include:

import './bootstrap';
import '../css/app.css';
import '/node_modules/@fortawesome/fontawesome-free/css/all.min.css';
import Alpine from 'alpinejs'
import $ from 'jquery';

window.Alpine = Alpine
document.addEventListener('DOMContentLoaded', () => {
    Alpine.start()
})

window.$ = $;
window.jQuery = $;

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.