Web Prepration

Web Concept Tutorials

Laravel 7

Here you can study most popular and useful tutorials of Laravel 7, we have lists of tutorials, Interview Questions and answers of  Laravel 7.

Larave 9, Laravel, Laravel 7, Laravel 8

In this article, I am going to explain laravel 9 many to many relationship. This tutorial give you simple example of laravel 9 belongstomany tutorial. This tutorial will give you simple example of laravel 9 many to many sync. So in this article, you can understand how to create many-to-many relationships with migration with a foreign key schema for one to many relationships, use sync with a pivot table, create records, attach records, get all records, delete, update, where condition and everything related to many to many relationship. Many to Many Relationship will use  “belongsToMany()”  for relation. So in this example, i will create  “posts”, “category” and “post_category” tables. each table is connected with each other. now we will create many to many relationships with each other by using the laravel Eloquent Model. We will first create database migration, then model, retrieve records and then how to create records too.

read more >>
Laravel, Laravel 7, Laravel 8, Others

In this article, we will cover “How to implement laravel conditional query”. I would like to show your laravel eloquent if condition but laravel added a new function when(), using when() you can ignore to write manually if conditional statement and else statement. I will give you some example how to use it when and how to write if condition with eloquent query builder. you can also use when() with laravel 6, laravel 7 and laravel 8 version: Simple When() Example:

When() Else Example:

Multiple When() Condition Example:

  WebpreprationI’m a full-stack developer.  My hobby and profession to write blog and programming tips that helps to others. I am a great admirer of PHP, Laravel, Codeigniter, AngularJS,  Vue.js,  Javascript, JQuery, WordPress, Plugin Development, Theme Development and Bootstrap from the early stage.   webprepration.com/

read more >>
Laravel, Laravel 7, Laravel 8
Clear cache in Laravel

In this articale, you will learn how to clear caches in laravel application. In laravel application you can clear cache two types using artisan command and from browsers. I will mention few commands you can use to clear various types of cache like config cache, view cache, route cache and application cache from your laravel application. If you want to clear cache using commnad then open your terminal and go to the laravel application’s folder and execute below commands: Clear Application Cache To clear laravel application cache, run the following artisan command:

Clear Route Cache To clear route cache of your Laravel application run the following artisan command:

Clear Configuration Cache To clear the config cache of your laravel application, run the following artisan command:

Clear Compiled Views Cache To clear the view cache of your laravel application which are basically compiled view files, run the following

read more >>
Laravel, Laravel 7, Laravel 8

In this article I will be explain “how to generate qr code in laravel”, In this article we will implements qr code in laravel 8. if you want to emplement qr code in your application then you are right place. simplesoftwareio/simple-qrcode simple-qrcode is package for generate qr code in laravel application. simple-qrcode provide to send sms and email with generated qr code. you can create qr code for geo, phoneNumber, birthdate using simple qrcode package. For that we require to install simple-qrcode package for qr code generator in application, So we just need to run below command in terminal.

After that open config/app.php file and add service provider and aliase.

Next we need to create route for testing qr-code

Now create a blade file to display the qr code, so let’s create blade file as like bellow code:

  WebpreprationI’m a full-stack developer.  My hobby and

read more >>
Laravel, Laravel 7, Laravel 8

When we are working on any projects then many times we need to get last executed query, If you are working on laravel framework and use laravel query builder And want to get last executed mysql query from laravel. Then you have to first enable query log that way it can be store query log. At last getQueryLog() through you can get last executed query. I give you example of how to get last executed mysql query. you can use example as following example.

  WebpreprationI’m a full-stack developer.  My hobby and profession to write blog and programming tips that helps to others. I am a great admirer of PHP, Laravel, Codeigniter, AngularJS,  Vue.js,  Javascript, JQuery, WordPress, Plugin Development, Theme Development and Bootstrap from the early stage.   webprepration.com/

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