Category

Laravel 7

Category

Laravel Pagination Add in Controller In this example the we need to pass only digit how many records need to find on same page. In this case, let’s specify that we would like to display 5 items per page: <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\DB; class BlogController extends Controller { public function index() { $blog = DB::table(‘blog’)->paginate(5); return view(‘blog’, [‘data’ => $blog]); } } Now view part within blog.blade.php <div class=”container”> @foreach ($data as…

https://www.youtube.com/watch?v=5cQye6YfaGI&t=2s&ab_channel=Realprogrammer Prerequisites PHP >= 7.1.3OpenSSL PHP ExtensionPDO PHP ExtensionMbstring PHP ExtensionTokenizer PHP ExtensionXML PHP ExtensionCtype PHP ExtensionJSON PHP Extension Getting started Check all Prerequisites are installed in your machine. then this tutorial is already looking for you, we will create 3 user class – admin, blogger, user and we will make guards for 3 user classes and restriction different parts of the application based on those guards. Create the applicationWe need to run command to…

Ajax Autocomplete Search in Laravel 7 Step 1: Install laravel 7 using composer composer create-project –prefer-dist laravel/laravel laravel7search Step 2: Going inside of project using the command cd laravel7search Step 3: Setup MySQL database Now, configure this database in the .env file. DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel7search DB_USERNAME=root DB_PASSWORD=root@123 Step 3: Create Migration and Model In this step, we have to create a migration for students table using Laravel 7 PHP artisan command, so first fire…

Do you want to send mail using SMTP in Laravel 7? then I will give your real-time example how to send mail in Laravel 7? In this tutorial, I will guide you on how to send mail in Laravel 7. I will create blade file and dynamic information to for mail layout. let’s start from begging. Step 1: Create a Laravel 7 project laravel new laravel_sendmail Step 2: Open laravel project set .env configuration MAIL_DRIVER=smtp…

Hey, Reader Here, I will brief you step by step login with google account in Laravel 7 socialite. in Laravel 7 socialite provides API to login with Gmail account. I will help you step by step instruction. let’s follow the tutorial and implement it. Step 1: Install Laravel 7 I am going to install Laravel 7 projects. laravel new google_login Now I am going inside of the folder cd google_login Step 2: Install Socialite In…

Step 1: Setup Laravel 7 We going to setup Laravel 7 projects in our machine laravel new laravel Step 2: Install dompdf Package we will install barryvdh/laravel-dompdf composer package by following composer command in your Laravel 7 application. we need to install barryvdh/laravel-dompdf composer package in our project. composer require barryvdh/laravel-dompdf After installation package, open config/app.php file and add service provider and alias. config/app.php ‘providers’ => [ …. Barryvdh\DomPDF\ServiceProvider::class, ], ‘aliases’ => [ …. ‘PDF’…

Step 1: Install Laravel 7 first of all, we need to get fresh Laravel 7 version application using bellow command, So open your terminal OR command prompt and run bellow command: laravel new laravel_blog Step 2: Database Configuration Open laravel_blog and set hostname, username, password and database name in .env file DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel_blog DB_USERNAME=root DB_PASSWORD=root Step 3: Create Migration Now we are going to create a blog. so we have to create a…

Laravel is a structure and it is really quick and fast. It is referred to as an improved and better framework. Laravel makes use of Eloquent because of which writing the database queries becomes easy. So it’s better to know the framework of laravel to make the things quick and fast and better in use. WordPress is referred to as mainly slow because of the use of plugins. WordPress is cheap and performance loads are…

Step 1: Install Laravel Project I am going to install a laravel project using composer. composer create-project –prefer-dist laravel/laravel laravel7datatables Step 2: Going inside of project using the command cd laravel7datatables Step 3: Setup MySQL database Now, configure this database in the .env file. DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel7datatables DB_USERNAME=root DB_PASSWORD=root@123 I have done local database credentials. Now migrate database php artisan migrate Step 4: Install yajra Package We going to install the yajra/laravel-datatables-oracle package by…

Add code inside of your controller and make the function this easiest way to make custom messages in methods when you want to validate requests: public function create() { request()->validate([ ‘name’ => ‘required’, ‘description’ => ‘required’ ], [ ‘name.required’ => ‘A name is required’, ‘description.required’ => ‘A description is required’ ]); }