How to Use Laravel 12 as Backend for a React SPA with Inertia.js
Автор: 𝗦𝘁𝗮𝗿𝗖𝗼𝗱𝗲 𝗞𝗵
Загружено: 2025-06-15
Просмотров: 166
Описание:
Hi there 👋, I’m Soeng Souy (StarCode Kh)
-------------------------------------------
🌱 I’m currently creating a sample Laravel and React Vue Livewire
👯 I’m looking to collaborate on open-source PHP & JavaScript projects
💬 Ask me about Laravel, MySQL, or Flutter
⚡ Fun fact: I love turning ☕️ into code!
--------------------------------------------
Full code:https://www.souysoeng.com/2025/06/lar...
--------------------------------------------
▸|00:00:00|Introduction
▸|00:00:29|What You'll Build
▸|00:00:38|Prerequisites (PHP, Composer, Node.js and npm ...)
▸|00:00:53|Create a Laravel 12 Project
▸|00:01:53|Configure Database
▸|00:02:24|Install Breeze with Inertia.js + React
▸|00:04:31|Create Post Model and Migration
▸|00:05:17|Define the schema
▸|00:05:42|Run migration
▸|00:06:40|Update the model app/Models/Post.php
▸|00:07:02|Create Post Controller
▸|00:07:13|Then update app/Http/Controllers/PostController.php
▸|00:07:55|Define Routes
▸|00:08:26|Create React Components
▸|00:08:30|Create Folder (Posts)
▸|00:08:55|resources/js/Pages/Posts/Index.jsx
▸|00:09:58|resources/js/Pages/Posts/Create.jsx
▸|00:10:36|resources/js/Pages/Posts/Edit.jsx
▸|00:11:12|Add Posts to Navigation Menu
▸|00:12:10|Run the App(php artisan serve, npm run dev)
▸|00:12:32|Visit: http://localhost:8000/
▸|00:12:50|Create bootstrap/app.php
▸|00:13:32|Register account
▸|00:14:12|Create Post
▸|00:14:30|Update Post
▸|00:15:24|Delete Post
▸|00:15:59|Directory structure
▸|00:16:16|Laravel Backend (Server-Side)
▸|00:16:22|Routes (web.php, api.php)
▸|00:16:27|React + Inertia Frontend (Client-Side)
▸|00:16:32|Views (app.blade.php)
▸|00:16:36|Public Assets
▸|00:16:39|Database(migrations)
▸|00:16:44|Summary
--------------------------------------------
Follow Soeng Souy on:
-------------------------------------------
Enjoying the content?
=================
► Subscribe here for FREE: / @laravelcrud
--------------------------------------------
► Telegram: https://t.me/starcodekh
--------------------------------------------
► Facebook page: / starcodekh
-------------------------------------------
► Website: https://souysoeng.com/
-------------------------------------------
► Fix Code: https://fixcodekh.com/
-------------------------------------------
► LinkedIn: / soengsouy
-------------------------------------------
► Twitter: / starcodekh
-------------------------------------------
𝗦𝘁𝗮𝗿𝗖𝗼𝗱𝗲 𝗞𝗵 :) Thank you for being so supportive!
-------------------------------------------
🔥 In this tutorial, learn how to use *Laravel 12* as a *backend* for a *React Single Page Application (SPA)* using **Inertia.js**! This is a powerful stack that bridges the simplicity of Laravel with the flexibility of modern React frontend development.
🧱 What You'll Learn:
How Inertia.js replaces the traditional API layer
Setting up Laravel 12 with React via Breeze
Configuring Vite and Inertia
Passing data from Laravel controllers to React components
Navigating pages without full page reloads (true SPA behavior)
💻 Tech Stack:
Laravel 12 (Backend)
Inertia.js (SPA Adapter)
React.js (Frontend)
Laravel Breeze (Inertia + React preset)
Vite (Bundler)
🚀 Why Use Inertia?
No need to build a separate API
Use Laravel routing, middleware, and validation as-is
Send props directly to React components from controllers
📚 Resources:
Laravel Docs 👉 https://laravel.com/docs
Inertia.js Docs 👉 https://inertiajs.com
✅ Like, 🔔 Subscribe, and 💬 Comment if you want source code or a deployment guide!
#Laravel12 #ReactSPA #InertiaJS #LaravelReact #FullStack
#coding #nginx #laravelvue #laraveldeveloper #programming #laravel #starcodekh #soengsouy
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: