Skip to content
October 7, 2026
Newsletter
Random News

  • AI
  • Javascript
  • React
  • Bash
  • Git
  • Magento
  • Mysql
  • Redis
  • Frontend
  • Backend
    • PHP
    • Laravel
    • Redis
  • Home
  • 2022
  • Page 10

Year: 2022

Javascript Logo
  • Javascript

How to find the sum of an array of numbers in Javascript?

Techradiant4 years ago4 years ago03 mins

< 1 min readTo find the sum of an array of numbers in JavaScript, you can use the reduce() method. The reduce() method allows you to apply a function to each element in the array, reducing the array to a single value. Here’s an example of how you can use the reduce() method to find the sum of…

Read More
Javascript Logo
  • Javascript

What is the difference between null and undefined in JavaScript?

Techradiant4 years ago4 years ago02 mins

< 1 min readIn JavaScript, null and undefined are both primitive values that represent the absence of a value or object. However, they have different meanings and uses. null is a value that represents the intentional absence of an object value. It is an explicit representation of no value. You can assign the value null to a variable…

Read More
  • Laravel
  • PHP

How to set the port for PHP artisan.php serve?

Techradiant4 years ago4 years ago01 mins

< 1 min readTo specify a port for the PHP development server when using the php artisan serve command, you can use the –port option followed by the desired port number. For example: This will start the development server on port 8000. If you omit the –port option, the development server will use the default port of 8000….

Read More
  • Laravel
  • PHP

How to redirect back with message in Laravel?

Techradiant4 years ago4 years ago02 mins

< 1 min readTo redirect back to the previous page with a message in Laravel, you can use the redirect()->back() method and pass a key-value pair to the with() method. The key will be the name of the variable that you want to use to store the message, and the value will be the message itself. Here’s an…

Read More
  • PHP

How to create a model, controller and migration from a single command in Laravel?

Techradiant4 years ago01 mins

< 1 min readYou can create a model, controller and migration from a single command in Laravel by using the following command. In Laravel 5.6 and newer, you can use the following command,

Read More
  • PHP

How to add a comment in a Laravel .env file?

Techradiant4 years ago4 years ago01 mins

< 1 min readTo add a comment in a Laravel .env file, you can use a # Hash. For example,

Read More
  • PHP

How to get the last item from a collection in Laravel?

Techradiant4 years ago01 mins

< 1 min readIn Laravel, you can use the last method of the Collection class to get the last item from a collection. Here’s an example of how you can use it: You can also pass a callback function to the last method to determine which item should be considered the last: In this example, the last method…

Read More
  • PHP

How to check if the collection is empty in Laravel?

Techradiant4 years ago01 mins

< 1 min readIn Laravel, you can use the isEmpty method of the Collection class to check if a collection is empty. Here’s an example of how you can use it: You can also use the isNotEmpty method to check if a collection is not empty: You can also use the isEmpty method in a chain of method…

Read More
  • PHP

How to rollback one specific migration in laravel?

Techradiant4 years ago4 years ago02 mins

< 1 min readIn Laravel, you can use the migrate:rollback Artisan command to rollback the last migration. To rollback a specific migration, you can pass the –step option to the command, followed by the number of migrations to rollback. For example, to rollback the last 2 migrations, you can run the following command: If you want to rollback…

Read More
  • PHP

How to check if a string starts with a specific string in PHP?

Techradiant4 years ago4 years ago02 mins

< 1 min readTo check if a string starts with a specific string in PHP, you can use the strpos function. This function searches for a string within another string and returns the position of the first occurrence. Here’s an example of how you can use it: PHP 8 and newer For PHP 7 and older In this…

Read More
  • 1
  • …
  • 8
  • 9
  • 10
  • 11
  • 12
  • …
  • 20

Sponsored

  • Top 12 AI Video Generators in 2026 (Compared by Use Case)
  • How to Push a Docker Image to Docker Hub (Step-by-Step Guide)
  • Meet Jev: The AI Model That Makes Decisions Instead of Sentences
  • How to use Claude Code for Free?
  • Dokploy vs Coolify: Which Self-Hosted PaaS Should You Actually Use in 2026?
TechRadiant 2026. Powered By BlazeThemes.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT