Laravel summernote image upload example tutorial, here you will learn how to use upload image with summernote in laravel apps.
If you are searching how to image upload in sumernote editor laravel application. So this laravel summernote editor in image upload laravel app tutorial will help you to upload images in summernote editor example.
This laravel summernote example guides you step by step on how to upload image with summernote wysiwyg editor in laravel apps.
Follow the below following 7 steps and upload image with summernote editor in laravel apps:
In this step, open a terminal and run the following command. This command will install or download laravel fresh application setup for implementing image upload with summernote editor in laravel app:
composer create-project --prefer-dist laravel/laravel blog
In this step, Navigate to your project root directory and open the “.env” file. Then add database details into .evn file, as follow:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=Enter_Your_Database_Name
DB_USERNAME=Enter_Your_Database_Username
DB_PASSWORD=Enter_Your_Database_Password
In this step,** create a migration for post table and post Model** in laravel app. So run the following command on command prompt:
cd blog
php artisan make:model Post -m
Next, Navigate to database/migrations and open create_posts_table.php. Then update the following code into create_books_table.php file, as follow:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->longText('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
}
#laravel #laravel 7