Author: Justin

Hi, I will do this in small post, Not write too much i will only give you example directly.. We can do this using two simple way Using .htaccess Using service provider Using .htaccess Open public/.htaccess <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder… RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Send Requests To Front Controller… RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> …

Read More

A website speed very important key for success of website. it’s an important key for SEO. Therefore, whenever we write any code in Laravel projects, we should try to make sure to optimise the code. I am giving you some techniques for quick performance improvements. Steps- Only select the field which you need in view/blade file. Use eager loading whenever possible Remove unused package Cache Use the latest version of PHP 1. Only select the field which you need in view/blade file This one is the most easy way to improve speed, this will transfer the data which is required…

Read More

In this post, i will show you, How we can get user Devices like Desktops, Mobile, Tablets, browsers like Chrome, Firefox, etc, and OS like Linux, OS X, and Windows. This will be required, we are creating a Project which you have to make according to Device or Browser, or OS platform Step 1. Install Laravel Step 2. Install Package (jenssegers/Agent) Step 3. Create controller and Route Step 4. Output Step 5. Conclusion Step 1. Install Laravel  As you are looking this example, so definitely you already installed the laravel app, But still i am showing you how we can…

Read More

In this post, I will show you how to create and download a zip file in Laravel 9. Laravel has a ZipArchive class for creating zip files. Create and download a ZIP file containing your Laravel 9 application. It assumes you already have Laravel installed so you can start coding right away. Step 1. Create Route Step 2. Create Controller Step 3. Call the Route to URL Step 4. Conclusion Step 1. Create Route Open web.php file then write a new route. Route::get(‘download’, [ZipDownloadController::class, ‘downloadZip’]); Step 2. Create Controller In this step create a new controller with name ZipDownloadController , You can choose your…

Read More

Hello Developers, In this post i will show, How we can create a helper and uses of it’s method in controller and blade file?  I will do this in some of steps, because some time we need it’s via alias some time direct, also use on blade file or Controller . Steps- 1. Create a helpers and its function static and normal. 2. Create alias of that helpers 3. Use on Controller 4. Use on blade file 5. Conclusions. Now start the coding… Step 1. Create a helpers and its function static and normal. As of now Laravel not provide…

Read More

I will show you how we can add SMS OTP authentication using Twilio using twilio verify method. Let’s start with steps- Install Laravel Install JetStream Create Middleware Create Controller and view file for Verification Run The app and Test. Install Laravel I will install latest Laravel using composer. composer create-project laravel/laravel OTP-Auth Install JetStream On above step you already installed Laravel now to to your project directory and install JetStream using below command. composer require laravel/jetstream and then php artisan jetstream:install inertia now, Finalizing The Installation npm install npm run build set database connection in .env file and…

Read More

Hello Champ’s, Today i will show you how to add User follow/unfollow system in Laravel 9. We will do this in steps wise. Download Laravel Install overtrue/laravel-follow Package Create Authentication Create Dummy Users using factory Changes in User Model Create Controller and Methods Create Blade files Add Routes Run the project  Step 1. Download Laravel Let’s start this example, we will start it by installing a new laravel application. if you have already installed, then skip following step. composer create-project laravel/laravel Laravel9FollowSystem Step 2. Install overtrue/laravel-follow Package Now here i will install laravel-follow package for follow/unfollow. So go to…

Read More

In this post i will show, how to install Tailwind CSS 3 in Laravel 9. I will do this in steps wise: Install Laravel Project Setup Tailwind CSS Add Tailwind CSS to app.css Import Vite Assets to Laravel Blade Run Vite Development Server Step 1. Install Laravel Project Install Laravel 9 using the below command. composer create-project laravel/laravel TailwindCSSExample; Step 2: Setup Tailwind CSS In this step, I will install Tailwind CSS and It’s dependency. Tailwind CSS Dependency PostCSS auto-prefixer We will install using below command. First install Tailwind CSS. npm install -D tailwindcss Install the dependency. npm install…

Read More

Hello, Today i will give you a small example , How we can increase session time in Laravel 9. This Process is very simple. In Laravel we can change in two ways. Using .env file Directly to config file Using .env file For this just change the value in .env like below. Default is 120, This value is in minute. So 120=2 Hours. Default value in .env file SESSION_LIFETIME=120 Now change it to 240 means, 4 hours. SESSION_LIFETIME=240 And now change in app/config/session.php file. ‘lifetime’ => env(‘SESSION_LIFETIME’, 240), Now your file will look like below <?php use Illuminate\Support\Str; return […

Read More

Hi, In this post i will show you, How we can add watermark on Image, That water mark can be a text or can be an Image , That can be your logo too. First you should understand why watermark is required on Image? A watermark is designed to do a few things. First and foremost, it can make your images harder to steal or less desirable for thieves. Watermarks are also useful for promoting your work by branding your photo with a logo that is easily recognized as your own. Believe it or not, watermarks are pretty controversial in…

Read More