Laravel Polymorphic Relationship: The Complete Guide

Laravel Polymorphic Relationship allows a model to belong to more than one other model on a single association. We will take an official Laravel documentation example for this tutorial. Let us take the example of “comment” in both posts and videos. Using polymorphic relationships, you can use a single comments table for both of these scenarios. By default, Laravel will […]

How to Drag and Drop File Upload Using Dropzone js in Laravel 9?

Dropzone is a Javascript plugin that provides drag-and-drop file uploads with image previews. It is not dependent on external JavaScript libraries like – jQuery.It is easy to add to the page. Dropzone.js is a jquery plugin, In dropzone.js we can select one by one image and also with a preview. After choosing an image from […]

 PHP –  Get & Post Methods

PHP provides two methods through which a client (browser) can send information to the server. These methods are given below, and discussed in detail: Get and Post methods are the HTTP request methods used inside the <form> tag to send form data to the server. HTTP protocol enables communication between the client and the server where a browser can be […]

Build Secure PHP REST API in Laravel 9 with Sanctum Auth

Laravel Sanctum authentication tutorial; In this tutorial, we will share how to create or build a secure PHP RESTful API in the Laravel application with the help of the Laravel sanctum package. Likewise, we will explain to you step by step how to test the Laravel Sanctum authentication REST API using the Postman testing tool. […]

PHP Strings

PHP string is a sequence of characters i.e., used to store and manipulate text. PHP supports only a 256-character set and so it does not offer native Unicode support. PHP String Functions In this chapter, we will look at some commonly used functions to manipulate strings strlen() – Return the Length of a String The […]

How to import Sweetalert2 into Laravel with NPM?

What is SweetAlert? Sweet Alert is a way to customize alerts in your games and websites. It allows you to change from a standard JavaScript button. We can add buttons, change the color text, and even add additional alerts that change depending on the user. How do you use SweetAlert in laravel blade? Steps to […]

How to Use Laravel CSRF Protection for Your Apps?

Introduction Cross-Site Request Forgery (CSRF) is a type of attack performed by the attacker to send requests to a system with the help of an authorized user who is trusted by the system. Laravel provides protection against CSRF attacks by generating a CSRF token. This CSRF token is generated automatically for each user. This token is nothing but a random […]