August 15, 2022

Full Laravel Restaurant Reservation Website | Laravel 9 Tutorial

composer create-project laravel/laravel food

php artisan migrate

composer require laravel/breeze --dev

php artisan breeze:install

npm install

npm run dev

php artisan migrate

php artisan make:seeder Admin

password = password

Section 2

php artisan make:middleware Admin

+

use App\Http\Middleware\Admin;

php artisan make:controller Admin/AdminController

Section 3

https://www.alpinetoolbox.com/examples/

https://github.com/jan-heise/responsive-navbar-with-dropdown

Migration and models

php artisan make:model Category -m

php artisan make:model Menu -m

php artisan make:model Table -m

php artisan make:model Reservation -m

$table->string('name');
$table->text('description');
$table->string('image');
$table->string('name');
$table->text('description');
$table->string('image');
$table->decimal('price', 10,2);
$table->string('name');
$table->integer('guest_number');
$table->string('status')->default('available');
$table->string('location');
$table->string('first_name');
$table->string('last_name');
$table->string('email');
$table->string('tel_number');
$table->dateTime('res_date');
$table->unsignedBigInteger('table_id');
$table->integer('guest_number');
Admin/Controllerlarning hammasing viewini tug'irlab chiqamiz 😡

Controllers

pastdagi kod
@props(['active'])@php$classes = ($active ?? false)            ? 'block px-4 py-2 mt-2 text-sm font-semibold text-gray-900 bg-gray-200 rounded-lg dark-mode:bg-gray-700 dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline'            : 'block px-4 py-2 mt-2 text-sm font-semibold text-gray-900 bg-transparent rounded-lg dark-mode:bg-transparent dark-mode:hover:bg-gray-600 dark-mode:focus:bg-gray-600 dark-mode:focus:text-white dark-mode:hover:text-white dark-mode:text-gray-200 hover:text-gray-900 focus:text-gray-900 hover:bg-gray-200 focus:bg-gray-200 focus:outline-none focus:shadow-outline';@endphp<a {{ $attributes->merge(['class' => $classes]) }}>    {{ $slot }}</a>
https://flowbite.com/docs/components/tables/

https://play.tailwindcss.com/w1aqeaHYI0

php artisan make:request CategoryStoreRequest 

Edit

<a href="{{route('admin.categories.edit', $category->id)}}" class="px-4 py-2 bg-red-500 hover:bg-red-300 rounded text-white">Edit</a>