Skip to content

Repository files navigation

SimpleBlog

A simple Blog developed using:

  • Laravel 11
  • React
  • Inertia

Project Steps

  • Create new Laravel project Laravel new SimpleBlog (Without StarterKit + PEST + SQLITE)
  • Add React, React Dom
npm i react, react-dom
npm install --save-dev @vitejs/plugin-react
composer require inertiajs/inertia-laravel
  • Create app.blade.php including vite & Inertia directives/scripts
  • Run
php artisan inertia:middleware

&& follow remaining steps as described in documentation

  • Set up Inertia front-end with React
npm install @inertiajs/react
  • Update resources\js\app.jsx as follows:
import { createInertiaApp } from '@inertiajs/react'
import { createRoot } from 'react-dom/client'

createInertiaApp({
  resolve: name => {
    const pages = import.meta.glob('./Pages/**/*.jsx', { eager: true })
    return pages[`./Pages/${name}.jsx`]
  },
  setup({ el, App, props }) {
    createRoot(el).render()
  },
})

About

Just for teaching purposes - Laravel & Inertia & React

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages