Monday, July 29, 2024

Fontawesome in Laravel

 npm install --save-dev vite

 

npm install --save @fortawesome/fontawesome-free

 

 Edit or create resources/css/app.css and add the following code:

@import '@fortawesome/fontawesome-free/css/fontawesome.css';
@import '@fortawesome/fontawesome-free/css/regular.css';
@import '@fortawesome/fontawesome-free/css/solid.css';
@import '@fortawesome/fontawesome-free/css/brands.css'; 


Edit or create vite.config.js file in the root directory of your Laravel project and configure Vite to bundle Font Awesome along with your asset

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: true,
        }),
    ],
});


Should you prefer SASS over CSS follow the steps outlined below.

First install SASS by running:

npm install -D sass 


Then edit resources/app.js and copy+paste the following code:

 

import './bootstrap';

import '@fortawesome/fontawesome-free/scss/fontawesome.scss';
import '@fortawesome/fontawesome-free/scss/brands.scss';
import '@fortawesome/fontawesome-free/scss/regular.scss';
import '@fortawesome/fontawesome-free/scss/solid.scss';
import '@fortawesome/fontawesome-free/scss/v4-shims.scss';

Monday, July 8, 2024

Ubuntu extend LVM

 https://packetpushers.net/blog/ubuntu-extend-your-default-lvm-space/

Sunday, May 26, 2024

Thursday, March 14, 2024

Validation Regex

 

 'name' => 'required|unique:rooms|not_regex:/(0)[1-9][0-9]{2}$/|min:2',

Friday, January 19, 2024

v-viewer

 

npm install v-viewer viewerjs

 onImageClick: function(attachment) {
     
        this.$viewerApi({
          attachments : attachment,
        })
     
    },


 

<div v-for="attachment in attachments" class="images" v-viewer>

Monday, January 8, 2024

Apache error

 

Get solution for the issue, need to change in apache2.conf file after that it will works,

old code in /etc/apache2/apache2.conf

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

changed in to

 <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>

after that, In order for Apache to understand rewrite rules, we first need to activate mod_rewrite. It's already installed, but it's disabled on a default Apache installation. Use the a2enmod command to enable the module:

$ sudo a2enmod rewrite

This will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.

$ sudo systemctl restart apache2

it works for me finally.