Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

How to set a Default image of the user’s profile image in the Laravel PHP Framework?

Spread the Knowledge

How to set a Default image of the user’s profile image in the Laravel PHP Framework?

Click Upload Profile Image.

Click Remove Old Profile Image.

Step 1. Create a new Project in Laravel, so open git bash. Write down the following command:-

$  composer create-project --prefer-dist laravel/laravel defaultimage "5.8.*"

Step 2. Move to project directory on git Bash, so write down the following command:-


$ cd defaultimage
Mysql Database connection Laravel

Step 3.  So, Create a Database for this and Go to XAMPP server->phpMyAdmin->Click New Database->defaultimage.

Step 4. Go to .env file to set the project path and give the project APP_URL, DB_DATABASE name and DB_USERNAME name.

APP_URL=http://localhost/defaultimage/public
DB_DATABASE=defaultimage
DB_USERNAME=root

Step 5. Create the user authentication scaffolding and write down the following command:-

$ php artisan make:auth
Run Project URL

Step 6. Add image column with default value into database/migrations/create_users_table.php.

$table->string('image')->default('user.png');
public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('image')->default('user.png');
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });
    }

Step 7. Now, Migrate the tables into the MySQL databaseWrite the following command in git Base.

$ php artisan migrate

Step 8. Now, Go to User.php file and write down the following code:-

Step 9. First of all, Link the storage directory. Write the following command:-

$ php artisan storage:link

Step 10. Now, Create images folder and store default image file. C:\xampp\htdocs\defaultimage\public\storage\images.

Step 11. After that, Go to layouts/app.blade.php file and write down the following code:-

Run Project URL