Skip to content

Commit

Permalink
Create endpoint, controller and front-end assets for SPA prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
range-of-motion committed Oct 23, 2023
1 parent f189d51 commit f6c5192
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/Http/Controllers/PrototypeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

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
Expand Up @@ -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']);
Expand Down

0 comments on commit f6c5192

Please sign in to comment.