How to use ReactJs in Laravel | EasyCode Sardar



How to use ReactJs in Laravel | EasyCode Sardar







First of all let me install laravel from npm command that we will grab from laravel.com official website.

I will install laravel via Composer Create-Project. 

composer create-project --prefer-dist laravel/laravel ProjectName





After installing laravel we will create new database in our phpmyadmin name anything as you want.
Next i am creating development server with command:
Php artisan serve



Open any coder editor you like and add this laravel project as workplace. and open file called "welcome.blade.php".
file path should be:
ProjectName/resources/views/welcome.blade.php 
In welcome blade file you have add/enable your js file for reactjs. and you will give a reactjs component id to any div for display reactjs data. my code is below:







Now open link: http://localhost:8000: on your browser to see output.
ProjectName/resources/js/News.js