How to Image Upload with Summernote in Laravel Tutorial

Mary-Kate Olsen
Release: 2024-10-29 00:55:02
Original
559 people have browsed it

How to Image Upload with Summernote in Laravel Tutorial

In this post, I will show you How to Image Upload with Summernote in Laravel 11 application.

Summernote is a WYSIWYG (What You See Is What You Get) editor that allows users to create rich text editors for web pages. It is an open-source, browser-based editor that takes advantage of a jQuery framework to provide a simple, intuitive interface for users to create, edit, and format their text. You Can Learn How to Generate Barcode in Laravel 11

In this tutorial, we will create a posts table with a title and body column. We will create a form with input for the title and Summernote rich textbox for the body, then save it to the database.
Step for How to Image Upload with Summernote in Laravel 11?

Step 1: Install Laravel 11

This step is not required; however, if you have not created the Laravel app, then you may go ahead and execute the below command:

composer create-project laravel/laravel SummernoteImageUpload
cd SummernoteImageUpload
Copy after login

Step 2: Create posts Table and Model

In the first step, we need to create a new migration for adding a “posts” table.

php artisan make:migration create_posts_table
Copy after login

database/migrations/2024_02_17_133331_create_posts_table.php

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up(): void
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->id();
            $table->string('title');
            $table->text('body');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down(): void
    {
        Schema::dropIfExists('posts');
    }
};
Copy after login

Read More

The above is the detailed content of How to Image Upload with Summernote in Laravel Tutorial. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!