Tag

Laravel 7

Browsing

Step 1: Install Laravel 7 Project I am going to install a laravel project using composer. composer create-project –prefer-dist laravel/laravel laravel7 Step 2: Going inside of project using the command cd laravel7 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=laravel7 DB_USERNAME=root DB_PASSWORD=root@123 Step 4: Route Setup Here I am going to create routes to get and post method. now open “routes/web.php” file and put below code.…

Step 1: Install Laravel 7 Project I am going to install a laravel project using composer. composer create-project –prefer-dist laravel/laravel laravel7 Step 2: Going inside of project using the command cd laravel7 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=laravel7 DB_USERNAME=root DB_PASSWORD=root@123 Step 4: Create employee_images Table and Model also. Here, I have created migration for employee_images using Laravel 7 php artisan command, you can check…

Today, I am going to show you how to create a custom 404 page in laravel 7.First, you need to create a page inside of resources/views/errors/404.blade.phpNow, Code inside of 404.blade.php <!DOCTYPE html> <html lang=”en”> <head> <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css”> <script src=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js” ></script> <style type=”text/css”> *{ transition: all 0.6s; } html { height: 100%; } body{ font-family: ‘Lato’, sans-serif; color: #888; margin: 0; } #main{ display: table; width: 100%; height: 100vh; text-align: center; } .fof{ display: table-cell;…

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…

Step 1: Install the laravel project using the command line. composer create-project –prefer-dist laravel/laravel laravel7ajax 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: run Migration command php artisan make:migration create_books_table Now go to app/datatabase/migrations and open books migration file and put code within migration file app/database/timestamp_create_books_table.php the below code here : <?php…

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…