AC
Company

Getting Started

Installation via Composer

Install Tailwind and FontAwesome, then the package via composer.

npm install tailwindcss @tailwindcss/vite
npm install @fortawesome/fontawesome-free
composer require andach/laravel-view-components
php artisan view-components:install
php artisan vendor:publish --tag=view-components-assets

You can (optionally) publish the config files and the views if you need to customise them.

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

Then 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';

Then you're done!

Configuration Files

This file comes with four configuration files.

  1. The main config file allows you to overwrite the views for individual components.
  2. The components config file allows you to overwrite the classes and styling for the components themselves.
  3. The menu config file allows you to define a static menu as a helper for an individual menu group.
  4. The variants config file allows you to change the colours throughout your application.

You do not have to publish all, or any of them - any unpublished files will use the defaults from the package itself.