-
composer.json
Open in GitHub{ // "require": { "php": "^7.3|^8.0", // "inertiajs/inertia-laravel": "^0.4.2", } // }
-
app/Http/Controllers/CategoryController.php
Open in GitHubuse Inertia\Inertia; class CategoryController extends Controller { public function index() { return Inertia::render ( 'Categories', [ 'categories' => auth()->user()->categories->all(), ] ); } // }
-
routes/web.php
Open in GitHubuse App\Http\Controllers\CategoryController; use Illuminate\Support\Facades\Route; Route::group(['middleware' => ['auth:sanctum', 'verified']], function () { // Route::group(['prefix' => 'entries', 'as' => 'entries.'], function () { Route::get('', [EntryController::class, 'index'])->name('show'); Route::put('/create', [EntryController::class, 'create'])->name('create'); }); }); //
-
resources/js/Pages/Categories.vue
Open in GitHub<template> <app-layout> <template #header> <h2 class="font-semibold text-xl text-gray-800 leading-tight"> Категории </h2> </template> <div class="py-12"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> <manage-category :categories="categories"/> </div> </div> </app-layout> </template> <script> import AppLayout from '@/Layouts/AppLayout' import Welcome from '@/Jetstream/Welcome' import ManageCategory from './Categories/ManageCategory' export default { components: { AppLayout, Welcome, ManageCategory, }, props: { categories: Object, }, } </script>