Category

Laravel 6

Category

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 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>

Step 1: Install the laravel project using the command line. composer create-project –prefer-dist laravel/laravel laravel7filter Step 2: Open project in code and use vs code terminal. Step 3: find .env file in root directory than setup database configuration. DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=database_name DB_USERNAME=database_username DB_PASSWORD=database_password Step 4 : Install Yajra Datatable composer require yajra/laravel-datatables-oracle Step 5: After that you need to set providers and alias. config/app.php ….. ‘providers’ => [ …. Yajra\DataTables\DataTablesServiceProvider::class, ] ‘aliases’ => [ ….…