node -v (v21.0.0)
npm -v (v10.2.0)
npx create-react-app reactecom
cd reactecom
npm start
npm install react-router-dom
npm install axios
npm install [email protected]
npm install sweetalert --save
Usage:
import swal from 'sweetalert';
swal("Hello world!");
CSRF Protection:To authenticate your SPA, your SPA's "login" page should first make a request to the /sanctum/csrf-cookie endpoint to initialize CSRF protection for the application:
axios.get('/sanctum/csrf-cookie').then(response => {
axios.post(`${constant.url}/api/register`, data).then((res) => {
});
});
๐ src
๐ assets
๐ admin
๐ assets
๐ css
๐ javascript
๐ frontend
๐ components
๐ admin
๐ Dashboard.js
๐ Profile.js
๐ Frontend
๐ auth
๐ Login.js
๐ Register.js
๐ Home.js
๐ layouts
๐ admin
๐ Footer.js
๐ MasterLayout.js
๐ Navbar.js
๐ Sidebar.js
๐ frontend
๐ Navbar.js
๐ routes
๐ Routes.js
if your are facing this error, you should add in your .env
file.
SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost