Web Prepration

Web Concept Tutorials

laravel Middleware

Laravel, Laravel 7, Laravel 8
Sanctum API

In this post, I am going to explain how to use sanctum api in laravel 8. Laravel 8 Sanctum provides a simple authentication system for SPAs (Single page applications), mobile applications token based APIs. Sanctum API allows each user of your application to generate multiple API tokens for their account. You can create mobile based API using sanctum, its provide fully restful api and for use in laravel to follow basic steps which is given below. Step 1: Install Laravel 8 In this step I am going to explain how to install fresh laravel 8, If you have already istalled then ignore installation steps, I am going to explain from scratch so, we need to get fresh Laravel 8 application using bellow command, So open your terminal OR command prompt and run bellow command:

Step 2: Install Sanctum In this step we need to install sanctum via the Composer

read more >>
Laravel
Disable SCRF token in Laravel

In this article, i am going to explain how to laravel disable csrf for route or how to laravel ignore CSRF for route. By default, the App\Http\Middleware\VerifyCsrfToken is applied globally on all route via Kernel.php registration in Laravel. But sometime we need to ignore some route for CSRF middleware in appliaction. For example, if you have integrated Stripe Payment Gateway and are utilizing their web-hook system, then you will need to exclude your webhook handler route from Laravel’s CSRF protection.So basically we will exclude route from middleware in laravel application. this solution will helps to use in laravel 5 and laravel 6. VerifyCsrfToken middleware will have $except array variable there you can easily add your URL and ignore from csrf token verification. so you can add as like bellow: You can utilize wildcards for route matching or define each one individually. app/Http/Middleware/VerifyCsrfToken.php

Read Also: How to make a cron

read more >>
Laravel, Others
Cron Jobs & Task Scheduling

In this post, I am going to explain “how to make a Cron job in laravel 6” or how to create cron job in laravel 6?. How to use task scheduling in laravel 6? then I will explain a simple example of cron job task scheduling with laravel also explain what is a scheduler in laravel. Laravel Cron Job Laravel Cron Job is an inbuilt task manager that gives your applications the ability to execute specific commands like sending a slack notification or removing inactive users at a periodic time. then we will need to use laravel task scheduler or cron job laravel. When working on any specific project which needs to run any task periodically like send notifications, promotions email, cleaning up the databases, executing the time-consuming tasks, etc. Cron uses a configuration file called crontab also known as Cron table to manage the task scheduling process. How To

read more >>
Interview Questions, Laravel

In this post, I am going to share some important questions for laravel interview. In this post share from basics to advance level questions and answers of laravel, which is mostly asked in interview. 1)  What is Laravel ? Answer:- Laravel is a free open source “PHP Framework ” based on MVC design pattern. It is created by Taylor Otwell. Laravel provides expressive and elegant syntax that helps in creating a wonderful web application easily and quickly. 2) How to install laravel via composer ? Answer:-  You can install Laravel via composer by running below command.

3) What is Lumen? Answer:-  Lumen is PHP micro-framework that built on Laravel’s top components.It is created by Taylor Otwell. It is perfect option for building Laravel based micro-services and fast REST API’s. It’s one of the fastest micro-frameworks available. 4) List some features of laravel 5.0 ? Answer:-   Inbuilt CRSF (cross-site request forgery ) Protection. Authentication Scaffolding

read more >>
CodeIgnitor, Laravel, PHP

In this post, I will be show you the easiest  way to implement  DataTables  server side processing in Laravel. Here I will show you how to fetch data  using ajax in laravel and render that data in DataTable with searching, Pagination and sorting with server side processing. This post is an extension to a previous post on DataTables, where we initiated data tables with basic initialization. As many readers suggested to make a tutorial on DataTables server-side. . In this post we have explain step by step. Because Jquery DataTables will add some advance features like quick search of table data, it will make automatic pagination without write of code, table column ordering, sorting of table column and many more. Now before we start coding include Datatables CSS file and Javascript files from CDN in your view page as follows.

Now let’s understand what all tasks we need to do

read more >>
CodeIgnitor, Laravel, PHP

In this tutorial, I am going to explain “How to create PDF from html in Laravel” by using laravel dompdf package. There are lots of pdf packages that are using to generate pdf from html with  CSS, you can easily set the beautiful layout for pdf file using css most of the packages support css in pdf. Using laravel-dompdf library, you can easily generate pdf file in your Laravel web application. When you are need to sending report in email from large amount of data then you can convert your html view in pdf file and attach that file with mail or if we work on big ERP level project on laravel, we require to generate PDF file for data from database table. In this tutorials we are using on of the best package barryvdh/laravel-dompdf it provide very easy way to generate html to pdf in laravel. We are explain all code step by step:- Step

read more >>