Category

Laravel 7

Category

How to Implement Google Charts in Laravel 7 App Example In this tutorial we will learn laravel 7 chart example from scratch. we will discuss about laravel 7 charts step by step everything about google chart.we will implement dynamic pie chart in laravel aslo we will utilize google chart api. Google provides the different types of charts such as Bar chart, Line chart, Area chart, Pie chart and many more. Today, we will try to…

Laravel 7 Cron Job Task Scheduling Step 1: Download laravel 8 project composer create-project –prefer-dist laravel/laravel CronJob Step 2: Configure Your database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=CronJob DB_USERNAME=root DB_PASSWORD=root@123 MAIL_DRIVER=smtp MAIL_HOST=smtp.googlemail.com MAIL_PORT=465 MAIL_USERNAME=realprogrammer@gmail.com MAIL_PASSWORD=realprogrammer*123 MAIL_ENCRYPTION=ssl Step 3: Create Custom Artisan Command You should now be in the root folder of your application. Type the following command to create the custom artisan command: php artisan make:command MinuteUpdate Now make some changes on Command file.…

Laravel 7 REST API with Passport Authentication Tutorial Step 1: Download laravel 7 project composer create-project –prefer-dist laravel/laravel laravelApi Go, Inside of folder cd laravelApi Step 2: Configure Your database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 Install Passport Package In this step we need to install passport via the Composer package manager, so one your terminal and fire bellow command: composer require laravel/passport After successfully install package, we require to get default…

Laravel 7 Highcharts Step 1: Download laravel 7 project composer create-project –prefer-dist laravel/laravel blog Step 2: Configure Your database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 Step 3: Create controller and put below code in your controller php artisan make:controller BlogContoller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Blog; class BlogController extends Controller { public function getRecord() { $blogs = Blog::select(\DB::raw(“COUNT(*) as count”)) ->whereYear(‘created_at’, date(‘Y’)) ->groupBy(\DB::raw(“Month(created_at)”)) ->pluck(‘count’); return view(‘chart’, compact(‘blogs’)); } } Step 4:…

Laravel 6 Multiple Database Connection Tutorial Step1: Install Laravel using composer composer create-project –prefer-dist laravel/laravel blog “6.*” Step 2: Configure Database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 DB_CONNECTION_SECOND=mysql2 DB_HOST_SECOND=127.0.0.1 DB_PORT_SECOND=3306 DB_DATABASE_SECOND=laravel2Db DB_USERNAME_SECOND=root DB_PASSWORD_SECOND=root@123 Step 3: Configure Database from config/database.php <?php use Illuminate\Support\Str; return [ ‘default’ => env(‘DB_CONNECTION’, ‘mysql’), ‘connections’ => [ ….. ‘mysql’ => [ ‘driver’ => ‘mysql’, ‘url’ => env(‘DATABASE_URL’), ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’), ‘port’ => env(‘DB_PORT’, ‘3306’), ‘database’ => env(‘DB_DATABASE’,…

Laravel 7 Multiple Database Connection Tutorial Step1: Install Laravel using composer composer create-project –prefer-dist laravel/laravel blog “7.*” Step 2: Configure Database from .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel1Db DB_USERNAME=root DB_PASSWORD=root@123 DB_CONNECTION_SECOND=mysql2 DB_HOST_SECOND=127.0.0.1 DB_PORT_SECOND=3306 DB_DATABASE_SECOND=laravel2Db DB_USERNAME_SECOND=root DB_PASSWORD_SECOND=root@123 Step 3: Configure Database from config/database.php <?php use Illuminate\Support\Str; return [ ‘default’ => env(‘DB_CONNECTION’, ‘mysql’), ‘connections’ => [ ….. ‘mysql’ => [ ‘driver’ => ‘mysql’, ‘url’ => env(‘DATABASE_URL’), ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’), ‘port’ => env(‘DB_PORT’, ‘3306’), ‘database’ => env(‘DB_DATABASE’,…

<form class=”newsletter” id=”newsletter”> @csrf <input type=”email” placeholder=”Enter your email address” name=”email” required=””> <button type=”submit”>Subscribe</button> </form> <script> $(‘.newsletter’).on(‘submit’, function(e) { e.preventDefault(); $.ajax({ type: “POST”, url: ‘newsletter’, data: $(this).serialize(), success: function(msg) { document.getElementById(“newsletter”).reset(); swal(“thank you for subscribing newsletter!”); } }); }); </script>