Monday, 23 January 2023

Important points to follow before making live project in laravel.

 Below are some points that should be kept in mind while making laravel project live.


1.    php artisan optimize:clear    

        composer install --optimize-autoloader --no-dev

        composer dump-autoload --optimize 

        Laravel Telescope: If you have installed packages like Laravel Telescope or Debugbar, you should            disable or remove them in production: To remove run below command
        composer remove laravel/telescope barryvdh/laravel-debugbar

        Use Composer to check for any known security vulnerabilities in your dependencies:

        composer audit

2.    In the .env file
                APP_DEBUG=false.

                APP_ENV=production

3.    In the app.php

        $envKeys = [];
$serverKeys = [];
$cookieKeys = [];
foreach ( $_ENV as $key => $value ) { if(is_string($value)) $envKeys[] = $key; }
foreach ( $_SERVER as $key => $value ) { if(is_string($value)) $serverKeys[] = $key; }
foreach ( $_COOKIE as $key => $value ) { if(is_string($value)) $cookieKeys[] = $key; }       

        Inside return [
            'debug_blacklist' => [
                '_COOKIE'   => $cookieKeys,
                '_SERVER'   => $serverKeys,
                '_ENV'      => $envKeys,
            ],

4. .htaccess

    <Files ~ "\.(git|env|json|config.js|md|gitignore|gitattributes|lock|example)$">
        Order allow,deny
        Deny from all
    </Files>

    <Files ~ "(artisan)$">
      Order allow,deny
        Deny from all
    </Files>

5.    Remove tests folder from project.

Wednesday, 4 January 2023

Laravel with Nextjs setup

 Steps to follow

composer create-project laravel/laravel example-app

cd example-app

php artisan serve

Open the .env file and update the database details

Add the below line before LOG_CHANNEL=stack

SESSION_DOMAIN=localhost

php artisan migrate

php artisan serve


composer require laravel/breeze --dev

php artisan breeze:install api


git clone https://github.com/laravel/breeze-next.git

cd breeze-next

npm install

rename the .env.example file to .env.local

npm run dev

Machine Learning - Potato Leaf Disease Prediction

Step 1: import numpy as np import pandas as pd import splitfolders import matplotlib.pyplot as plt import tensorflow as tf from tensorflow i...