Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create prototype for SPA #440

Merged
merged 9 commits into from
Nov 18, 2023
Next Next commit
Create endpoint, controller and front-end assets for SPA prototype
range-of-motion committed Nov 18, 2023
commit 8bebee5de650eba9246e533c11e5a01345af79bc
11 changes: 11 additions & 0 deletions app/Http/Controllers/PrototypeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace App\Http\Controllers;

class PrototypeController extends Controller
{
public function __invoke()
{
return view('prototype');
}
}
Empty file.
8 changes: 8 additions & 0 deletions resources/assets/js/prototype/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Vue from 'vue';

import App from './components/App.vue';

const app = new Vue({
el: '#app',
render: h => h(App)
})
9 changes: 9 additions & 0 deletions resources/assets/js/prototype/components/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup>
//
</script>

<template>
<div>
<div>Hello world</div>
</div>
</template>
7 changes: 7 additions & 0 deletions resources/views/prototype.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<body>
<div id="app"></div>
@vite('resources/assets/js/prototype/app.js')
</body>
</html>
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -27,6 +27,8 @@

Route::get('/', [IndexController::class, 'index'])->name('index');

Route::get('/prototype', \App\Http\Controllers\PrototypeController::class);

Route::group(['middleware' => ['guest']], function () {
Route::get('/login', [LoginController::class, 'index'])->name('login');
Route::post('/login', [LoginController::class, 'store']);