ikinci adım;
Route::get(‘/’,[\App\Http\Controllers\IndexController::class,’index’]);
Route::get(‘/hello’,[\App\Http\Controllers\IndexController::class,’show’]);
normal route ekle. ilgili controller tabi. index fonksiyonu
1 |
return inertia('Index/Index'); |
resources/js/Pages/Index/Index.vue oluştur.
1 2 3 4 5 6 7 8 |
<template> <div>Index</div> <Link href="/hello">Show Page</Link> </template> <script setup> import {Link} from '@inertiajs/vue3' </script> |
hepsi bu kadar.
welcome.blade.php yi app.blade.php olarak değiştir
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Larazillow</title> @vite('resources/js/app.js') @inertiaHead </head> <body> @inertia </body> </html> |
https://github.com/piotr-jura-udemy/master-laravel-vue-fullstack/commit/bdacfe98ac2fe52689634ef34efcbdaa9fdda0fe
bunu da uygula