Skip to content

Commit 0fbb785

Browse files
authored
Merge pull request #1 from SyncfusionExamples/dev
Updating the README.md
2 parents 394b807 + c478391 commit 0fbb785

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# How to Integrate Syncfusion EJ2 React Components in Laravel project
2+
23
The following steps is used to Integrate Syncfusion EJ2 React Rich Text Editor in Laravel using Vite.
34

45
Skip to the getting started section if you have already configured the environment.
56

67
## Prerequisites
78

89
Before getting started with Syncfusion React Rich Text Editor component in Laravel using Vite, check whether the following are installed in the developer machine.
10+
911
* [PHP](https://www.php.net/downloads.php) - To download PHP.
1012
* [Node.js](https://nodejs.org/en/download/) - To download Node.js.
1113
* [Laravel](https://laravel.com/docs/8.x/installation) - To install Laravel.
@@ -34,7 +36,6 @@ composer global require laravel/installer
3436

3537
## Create a Laravel project
3638

37-
3839
#### For Windows users
3940

4041
```bash
@@ -47,35 +48,44 @@ Now change the directory to the example-app folder.
4748
cd example-app
4849
```
4950

50-
5151
## Getting started from Laravel Project
5252

53+
This section describes how to add the React, EJ2 Components from scratch to the Laravel Project.
54+
5355
### 1. Install dependencies
54-
This section describes how to add the React, EJ2
56+
5557
In the command prompt, run the following commands to install the dependencies.
5658

5759
If you are cloning the github repository please goto Run the project.
5860

5961
Install the dependencies of the laravel project.
62+
6063
```bash
6164
composer install
6265
```
66+
6367
If you are getting any error while installing the dependencies, run the following command.
68+
6469
```bash
6570
composer install --ignore-platform-req=ext-fileinfo
6671
```
6772

6873
Install the React js dependencies.
74+
6975
```bash
7076
npm install react react-dom @vitejs/plugin-react
7177
```
78+
7279
Install the Syncfusion EJ2 React Rich Text Editor package.
80+
7381
```bash
7482
npm install @syncfusion/ej2-react-richtexteditor
7583
```
7684

7785
### 2. Configure the vite.config.js file
86+
7887
Add the following code to the vite.config.js file in the root directory of the project.
88+
7989
```js
8090
import { defineConfig } from "vite";
8191
import laravel from "laravel-vite-plugin";
@@ -94,7 +104,9 @@ export default defineConfig({
94104
```
95105

96106
### 3. Add the root element to the welcome.blade.php file
107+
97108
Add the root element to the welcome.blade.php file in the resources/views folder.
109+
98110
``` html
99111
<!DOCTYPE html>
100112
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
@@ -123,6 +135,7 @@ Add the root element to the welcome.blade.php file in the resources/views folder
123135
### 4. Add the following code to the app.jsx file to mount the React application
124136

125137
Rename the `app.js` to `app.jsx` and mount the React component.
138+
126139
```js
127140
//Import and create a React root component
128141
import React from "react";
@@ -134,6 +147,7 @@ ReactDOM.render(<Welcome />, document.getElementById("app"));
134147
```
135148

136149
### 5. Create a Welcome.React file in the resources/js folder and add the following code
150+
137151
```jsx
138152

139153
import { HtmlEditor, Image, Inject, Link, QuickToolbar, RichTextEditorComponent, Toolbar } from '@syncfusion/ej2-react-richtexteditor';
@@ -189,8 +203,13 @@ export default Welcome;
189203
```
190204

191205
## Run the Project
206+
207+
To run the application run the following commands.
208+
192209
### 1. Build the project
210+
193211
To build the project, run the following command.
212+
194213
```bash
195214
npm run build
196215
```
@@ -204,9 +223,11 @@ php artisan key:generate
204223
```
205224

206225
### 3. Run the project
226+
207227
To run the project, run the following command.
228+
208229
```bash
209230
php artisan serve
210231
```
211232

212-
Visit http://localhost:8000 in your browser to see the Laravel application with the integrated Syncfusion EJ2 React Rich Text Editor.
233+
Visit <http://localhost:8000> in your browser to see the Laravel application with the integrated Syncfusion EJ2 React Rich Text Editor.

0 commit comments

Comments
 (0)