Web Prepration

Web Concept Tutorials

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

In this post, I am going to explain How to remove foreign key constraint and database column that hosts a foreign key relationship, and we add wrong column with foreign key constraint on table. here, we will remove foreign key constraint using migration in laravel 6, laravel 7 and laravel 8. We can’t remove directly using dropColumn() if column applied foreign key constraint, So we should drop foreign key constraint of that column using dropForeign() and then we can delete column using dropColumn(). You can see as bellw migration, first i added migration with wrong column then other migration for remove that column. Wrong Column Migration:

Drop Column Migration:

  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

read more >>
Laravel

Laravel is the PHP framework for web artisans. This is a reference to its carefully crafted components, as Laravel is one of the greatest examples of good programming practices and workflow. “Top App Development Companies” While it is based on other frameworks, such as Symfony, Laravel delivers a more digested version of a framework that is easy and ready-to-use and is heavily documented. Laravel is a prominent member of a new generation of web frameworks. It is a free, open-source PHP web framework, created by Taylor Otwell back in 2011 and intended for the development of web applications following the MVC model. Some of the key point features of Laravel : Restful routing. Inherent Database Version control A lightweight Blade Templating Engine Composer – An amazing tool that lets you manage your application’s third-party packages easily. Comes bundled with Eloquent – Built-in unit testing and simply readable impressive syntax Larger

read more >>