├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Http │ ├── Controllers │ │ └── Controller.php │ └── Middleware │ │ └── AdminMiddleware.php ├── Livewire │ ├── AboutUs.php │ ├── AddCategory.php │ ├── AddProductForm.php │ ├── AdminDashboard.php │ ├── AllProducts.php │ ├── BreadCrumb.php │ ├── Contacts.php │ ├── EditProduct.php │ ├── Footer.php │ ├── Header.php │ ├── HeroSection.php │ ├── ItemCard.php │ ├── ManageCategories.php │ ├── ManageOrders.php │ ├── ManageProduct.php │ ├── ProductDetails.php │ ├── ProductListing.php │ ├── ProductSection.php │ ├── ProductTable.php │ ├── ShoppingCartComponent.php │ └── ShoppingCartIcon.php ├── Models │ ├── Category.php │ ├── Product.php │ ├── ShoppingCart.php │ └── User.php └── Providers │ └── AppServiceProvider.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── providers.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── database.php ├── devdojo │ └── auth │ │ ├── appearance.php │ │ ├── descriptions.php │ │ ├── language.php │ │ ├── providers.php │ │ └── settings.php ├── filesystems.php ├── logging.php ├── mail.php ├── queue.php ├── services.php └── session.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 0001_01_01_000000_create_users_table.php │ ├── 0001_01_01_000001_create_cache_table.php │ ├── 0001_01_01_000002_create_jobs_table.php │ ├── 2024_04_24_000001_add_user_social_provider_table.php │ ├── 2024_04_24_000002_update_passwords_field_to_be_nullable.php │ ├── 2024_05_07_000003_add_two_factor_auth_columns.php │ ├── 2024_07_25_171025_add_role_column_to_users_table.php │ ├── 2024_07_25_171145_create_categories_table.php │ ├── 2024_07_25_214115_create_products_table.php │ └── 2024_08_01_133930_create_shopping_carts_table.php └── seeders │ └── DatabaseSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── postcss.config.js ├── public ├── .htaccess ├── auth │ ├── app.css │ ├── build │ │ ├── assets │ │ │ ├── scripts.js │ │ │ └── styles.css │ │ └── manifest.json │ └── img │ │ ├── favicon-dark.png │ │ ├── favicon.ico │ │ └── favicon.png ├── favicon.ico ├── images │ ├── 1.jpg │ └── placeholder-image.jpg ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ ├── admin-layout.blade.php │ ├── components │ ├── categories.blade.php │ ├── layouts │ │ └── app.blade.php │ ├── navigation │ │ └── view-all.blade.php │ └── search-component.blade.php │ ├── errors │ └── 404.blade.php │ ├── livewire │ ├── about-us.blade.php │ ├── add-category.blade.php │ ├── add-product-form.blade.php │ ├── admin-dashboard.blade.php │ ├── all-products.blade.php │ ├── bread-crumb.blade.php │ ├── contacts.blade.php │ ├── edit-product.blade.php │ ├── footer.blade.php │ ├── header.blade.php │ ├── hero-section.blade.php │ ├── item-card.blade.php │ ├── manage-categories.blade.php │ ├── manage-orders.blade.php │ ├── manage-product.blade.php │ ├── product-details.blade.php │ ├── product-listing.blade.php │ ├── product-section.blade.php │ ├── product-table.blade.php │ ├── shopping-cart-component.blade.php │ ├── shopping-cart-icon.blade.php │ ├── skeleton │ │ └── item-skeleton.blade.php │ └── theaders │ │ └── th.blade.php │ └── welcome.blade.php ├── routes ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── vite.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_TIMEZONE=UTC 6 | APP_URL=http://localhost 7 | 8 | APP_LOCALE=en 9 | APP_FALLBACK_LOCALE=en 10 | APP_FAKER_LOCALE=en_US 11 | 12 | APP_MAINTENANCE_DRIVER=file 13 | # APP_MAINTENANCE_STORE=database 14 | 15 | BCRYPT_ROUNDS=12 16 | 17 | LOG_CHANNEL=stack 18 | LOG_STACK=single 19 | LOG_DEPRECATIONS_CHANNEL=null 20 | LOG_LEVEL=debug 21 | 22 | DB_CONNECTION=mysql 23 | DB_HOST=127.0.0.1 24 | DB_PORT=3306 25 | DB_DATABASE=minimal_ecommerce_tall_stack 26 | DB_USERNAME=root 27 | DB_PASSWORD= 28 | 29 | SESSION_DRIVER=database 30 | SESSION_LIFETIME=120 31 | SESSION_ENCRYPT=false 32 | SESSION_PATH=/ 33 | SESSION_DOMAIN=null 34 | 35 | BROADCAST_CONNECTION=log 36 | FILESYSTEM_DISK=local 37 | QUEUE_CONNECTION=database 38 | 39 | CACHE_STORE=database 40 | CACHE_PREFIX= 41 | 42 | MEMCACHED_HOST=127.0.0.1 43 | 44 | REDIS_CLIENT=phpredis 45 | REDIS_HOST=127.0.0.1 46 | REDIS_PASSWORD=null 47 | REDIS_PORT=6379 48 | 49 | MAIL_MAILER=log 50 | MAIL_HOST=127.0.0.1 51 | MAIL_PORT=2525 52 | MAIL_USERNAME=null 53 | MAIL_PASSWORD=null 54 | MAIL_ENCRYPTION=null 55 | MAIL_FROM_ADDRESS="hello@example.com" 56 | MAIL_FROM_NAME="${APP_NAME}" 57 | 58 | AWS_ACCESS_KEY_ID= 59 | AWS_SECRET_ACCESS_KEY= 60 | AWS_DEFAULT_REGION=us-east-1 61 | AWS_BUCKET= 62 | AWS_USE_PATH_STYLE_ENDPOINT=false 63 | 64 | VITE_APP_NAME="${APP_NAME}" 65 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /node_modules 3 | /public/build 4 | /public/hot 5 | /public/storage 6 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | .phpactor.json 12 | .phpunit.result.cache 13 | Homestead.json 14 | Homestead.yaml 15 | auth.json 16 | npm-debug.log 17 | yarn-error.log 18 | /.fleet 19 | /.idea 20 | /.vscode 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Code with SJM Logo

2 | 3 | --- 4 | 5 | # Build a Minimal E-commerce App with Laravel 11 and Livewire 3 | TALL Stack 6 | 7 | ## Introduction 8 | Welcome to the Minimal E-commerce App project! This guide will walk you through building a basic e-commerce application using the TALL stack (Tailwind CSS, Alpine.js, Laravel, Livewire). 9 | 10 | ## Features 11 | 12 | - **Setting up the development environment** 13 | - **Designing the landing page with Tailwind CSS & hyper-ui** 14 | - **Creating models, relationships, and migrations for products, categories, and users** 15 | - **Setting up authentication with DevDojo Auth Package** 16 | - **Building the product listing & product detail page** 17 | - **Building the product CRUD operations with Livewire components (admin)** 18 | - **Implementing the shopping cart with Livewire** 19 | - **Order creation by customer** 20 | - **Implementing order management for the admin dashboard** 21 | 22 | ## Implementation Steps 23 | 24 | ### 1. Setting up the Development Environment 25 | - Install Laravel 11 26 | - Configure Livewire 3 27 | - Integrate Tailwind CSS 28 | 29 | ### 2. Setting up Authentication with DevDojo Auth Package 30 | - Install the DevDojo Auth package 31 | - Configure authentication routes and views 32 | 33 | ### 3. Designing the Landing Page with Tailwind CSS & hyper-ui 34 | - Create a responsive landing page 35 | - Use Tailwind CSS for styling 36 | - Utilize hyper-ui components 37 | 38 | ### 4. Building the Product Listing & Product Detail Page 39 | - Create Livewire components for product listing 40 | - Design product detail page 41 | 42 | ### 5. Creating Models, Relationships, and Migrations for Products, Categories, and Users 43 | - Define models and relationships 44 | - Create and run migrations 45 | 46 | ### 6. Building the Product CRUD Operations with Livewire Components (Admin) 47 | - Create Livewire components for CRUD operations 48 | - Implement admin views 49 | 50 | ### 7. Implementing the Shopping Cart with Livewire 51 | - Create a shopping cart component 52 | - Handle adding, updating, and removing items 53 | 54 | 55 | ## Conclusion 56 | This project aims to provide a comprehensive guide for building a minimal e-commerce app using the TALL stack. Each step is designed to be straightforward and provide practical knowledge for developing modern web applications. 57 | 58 | --- 59 | 60 | 61 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | user() && auth()->user()->role == 1) { 19 | return $next($request); 20 | } 21 | 22 | return redirect('/auth/login'); 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Livewire/AboutUs.php: -------------------------------------------------------------------------------- 1 | validate([ 15 | 'category_name' => 'required' 16 | ]); 17 | 18 | $category = new Category(); 19 | $category->name = $this->category_name; 20 | $category->save(); 21 | 22 | return $this->redirect('/manage/categories', navigate: true); 23 | } 24 | public function render() 25 | { 26 | $current_url = url()->current(); 27 | $explode_url = explode('/',$current_url); 28 | 29 | $this->currentUrl = $explode_url[3].' '.$explode_url[4]; 30 | return view('livewire.add-category')->layout('admin-layout'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Livewire/AddProductForm.php: -------------------------------------------------------------------------------- 1 | all_categories = Category::all(); 26 | } 27 | 28 | public function save(){ 29 | $this->validate([ 30 | 'product_name' => 'required', 31 | 'photo' => 'image|required|mimes:jpg,png|max:1024', 32 | 'product_description' => 'required', 33 | 'product_price' => 'required|numeric', 34 | 'category_id' => 'required', 35 | ]); 36 | 37 | $path = $this->photo->store('public/photos'); 38 | 39 | $product = new Product(); 40 | $product->name = $this->product_name; 41 | $product->image = $path; 42 | $product->description = $this->product_description; 43 | $product->price = $this->product_price; 44 | $product->category_id = $this->category_id; 45 | $product->save(); 46 | 47 | return $this->redirect('/products', navigate: true); 48 | } 49 | public function render() 50 | { 51 | $current_url = url()->current(); 52 | $explode_url = explode('/',$current_url); 53 | 54 | $this->currentUrl = $explode_url[3].' '.$explode_url[4]; 55 | 56 | return view('livewire.add-product-form') 57 | ->layout('admin-layout'); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/Livewire/AdminDashboard.php: -------------------------------------------------------------------------------- 1 | current(); 17 | $explode_url = explode('/',$current_url); 18 | 19 | $this->currentUrl = $explode_url[3].' '.$explode_url[4]; 20 | 21 | return view('livewire.admin-dashboard') 22 | ->layout('admin-layout'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Livewire/AllProducts.php: -------------------------------------------------------------------------------- 1 | url = $url; 12 | } 13 | public function render() 14 | { 15 | return view('livewire.bread-crumb'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Livewire/Contacts.php: -------------------------------------------------------------------------------- 1 | title('E-commerce | Contact us'); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/Livewire/EditProduct.php: -------------------------------------------------------------------------------- 1 | product_details = Product::find($id); 23 | $this->product_name = $this->product_details->name; 24 | $this->product_description = $this->product_details->description; 25 | $this->product_price = $this->product_details->price; 26 | $this->category_id = $this->product_details->category_id; 27 | $this->photo = $this->product_details->image; 28 | // dd($this->product_details); 29 | $this->all_categories = Category::all(); 30 | } 31 | public function update(){ 32 | //validation 33 | $this->validate([ 34 | 'product_name' => 'required|string|max:255', 35 | 'product_description' => 'required|string', 36 | 'product_price' => 'required|numeric', 37 | 'category_id' => 'required|exists:categories,id', 38 | 'photo' => 'nullable|image|max:1024', // Validate the photo 39 | ]); 40 | //check if the image update/uploaded 41 | if ($this->photo && !is_string($this->photo)) { 42 | $photoPath = $this->photo->store('photos', 'public'); 43 | } else { 44 | $photoPath = $this->photo; // Keep the old image path 45 | } 46 | 47 | $this->product_details->update([ 48 | 'name' => $this->product_name, 49 | 'description' => $this->product_description, 50 | 'price' => $this->product_price, 51 | 'category_id' => $this->category_id, 52 | 'image' => $photoPath, 53 | ]); 54 | 55 | return $this->redirect('/products', navigate: true); 56 | } 57 | public function render() 58 | { 59 | // $current_url = url()->current(); 60 | 61 | // $explode_url = explode('/',$current_url); 62 | // // dd($explode_url); 63 | // $this->currentUrl = $explode_url[3].' '.$explode_url[5]; 64 | 65 | return view('livewire.edit-product')->layout('admin-layout'); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/Livewire/Footer.php: -------------------------------------------------------------------------------- 1 | product = $product_details; 14 | } 15 | public function placeholder(){ 16 | return view('livewire.skeleton.item-skeleton'); 17 | } 18 | 19 | //adding item to cart 20 | public function addToCart($productId) 21 | { 22 | $cartItem = ShoppingCart::where('user_id', Auth::id()) 23 | ->where('product_id', $productId) 24 | ->first(); 25 | 26 | if ($cartItem) { 27 | $cartItem->quantity += 1; // increment its quantity 28 | $cartItem->save(); 29 | } else { 30 | ShoppingCart::create([ 31 | 'user_id' => Auth::id(), 32 | 'product_id' => $productId, 33 | 'quantity' => 1, 34 | ]); 35 | } 36 | //dispatch 37 | $this->dispatch('cartUpdated'); 38 | } 39 | public function render() 40 | { 41 | return view('livewire.item-card'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Livewire/ManageCategories.php: -------------------------------------------------------------------------------- 1 | sortBy == $sortColum) { 21 | $this->sortDir = ($this->sortDir == 'ASC') ? 'DESC' : 'ASC'; 22 | return; 23 | } 24 | 25 | $this->sortBy = $sortColum; 26 | $this->sortDir = 'ASC'; 27 | } 28 | public function render() 29 | { 30 | $current_url = url()->current(); 31 | $explode_url = explode('/',$current_url); 32 | 33 | $this->currentUrl = $explode_url[3].' '.$explode_url[4]; 34 | 35 | return view('livewire.manage-categories',[ 36 | 'categories' => Category::search($this->search) 37 | ->orderBy($this->sortBy,$this->sortDir) 38 | ->paginate($this->perPage) 39 | ]) 40 | ->layout('admin-layout'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Livewire/ManageOrders.php: -------------------------------------------------------------------------------- 1 | layout('admin-layout'); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/Livewire/ManageProduct.php: -------------------------------------------------------------------------------- 1 | layout('admin-layout'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Livewire/ProductDetails.php: -------------------------------------------------------------------------------- 1 | product = Product::find($product_id); 15 | } 16 | 17 | //adding item to cart 18 | public function addToCart($productId) 19 | { 20 | $cartItem = ShoppingCart::where('user_id', Auth::id()) 21 | ->where('product_id', $productId) 22 | ->first(); 23 | 24 | if ($cartItem) { 25 | $cartItem->quantity += 1; // increment its quantity 26 | $cartItem->save(); 27 | } else { 28 | ShoppingCart::create([ 29 | 'user_id' => Auth::id(), 30 | 'product_id' => $productId, 31 | 'quantity' => 1, 32 | ]); 33 | } 34 | //dispatch 35 | $this->dispatch('cartUpdated'); 36 | } 37 | public function render() 38 | { 39 | return view('livewire.product-details'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Livewire/ProductListing.php: -------------------------------------------------------------------------------- 1 | category_id = $category_id; 19 | $this->current_product_id = $current_product_id; 20 | $this->updateProductList(); 21 | } 22 | 23 | public function updatedSearchTerm() 24 | { 25 | $this->updateProductList(); 26 | } 27 | 28 | public function updateProductList() 29 | { 30 | if ($this->category_id == 0) { 31 | $this->products = Product::with('category') 32 | ->where('id', '!=', $this->current_product_id) 33 | ->where('name', 'like', '%' . $this->searchTerm . '%') 34 | ->orderBy('created_at', 'DESC') 35 | ->limit(4) 36 | ->get(); 37 | } elseif ($this->category_id == 'all') { 38 | $this->products = Product::with('category') 39 | ->where('name', 'like', '%' . $this->searchTerm . '%') 40 | ->get(); 41 | } else { 42 | $this->products = Product::with('category') 43 | ->where('category_id', $this->category_id) 44 | ->where('id', '!=', $this->current_product_id) 45 | ->where('name', 'like', '%' . $this->searchTerm . '%') 46 | ->limit(4) 47 | ->get(); 48 | } 49 | } 50 | 51 | public function render() 52 | { 53 | return view('livewire.product-listing', [ 54 | 'categories' => Category::all() 55 | ]); 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /app/Livewire/ProductSection.php: -------------------------------------------------------------------------------- 1 | sortBy == $sortColum) { 22 | $this->sortDir = ($this->sortDir == 'ASC') ? 'DESC' : 'ASC'; 23 | return; 24 | } 25 | 26 | $this->sortBy = $sortColum; 27 | $this->sortDir = 'ASC'; 28 | } 29 | 30 | public function delete($id){ 31 | $product = Product::find($id); 32 | 33 | $product->delete(); 34 | 35 | return $this->redirect('/products', navigate: true); 36 | } 37 | public function render() 38 | { 39 | $current_url = url()->current(); 40 | $explode_url = explode('/',$current_url); 41 | 42 | $this->currentUrl = $explode_url[3]; 43 | 44 | return view('livewire.product-table',[ 45 | 'products' => Product::with('category')->search($this->search) 46 | ->orderBy($this->sortBy,$this->sortDir) 47 | ->paginate($this->perPage) 48 | ]); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Livewire/ShoppingCartComponent.php: -------------------------------------------------------------------------------- 1 | 'render', 21 | ]; 22 | public function mount(){ 23 | $this->cartItems = $this->getCartItems(); 24 | $this->calculateTotals(); 25 | } 26 | 27 | //calculate the totals 28 | public function calculateTotals() 29 | { 30 | $this->subtotal = $this->cartItems->sum(function($item) { 31 | return $item->quantity * $item->product->price; 32 | }); 33 | $this->vat = $this->subtotal * 0.1; // 10% VAT example 34 | $this->discount = 5; // Apply your discount logic here 35 | $this->total = $this->subtotal + $this->vat - $this->discount; 36 | } 37 | 38 | //get the details of shopping cart 39 | public function getCartItems() 40 | { 41 | return ShoppingCart::with('product') 42 | ->where('user_id', Auth::id()) 43 | ->get(); 44 | } 45 | //adding item to cart 46 | public function addToCart($productId) 47 | { 48 | $cartItem = ShoppingCart::where('user_id', Auth::id()) 49 | ->where('product_id', $productId) 50 | ->first(); 51 | 52 | if ($cartItem) { 53 | $cartItem->quantity += 1; // increment its quantity 54 | $cartItem->save(); 55 | } else { 56 | ShoppingCart::create([ 57 | 'user_id' => Auth::id(), 58 | 'product_id' => $productId, 59 | 'quantity' => 1, 60 | ]); 61 | } 62 | //dispatch 63 | $this->dispatch('cartUpdated'); 64 | } 65 | 66 | //update cart function 67 | public function updateQuantity($cartItemId, $quantity) 68 | { 69 | $cartItem = ShoppingCart::find($cartItemId); 70 | if ($cartItem) { 71 | $cartItem->quantity = $quantity; 72 | $cartItem->save(); 73 | $this->dispatch('cartUpdated'); 74 | } 75 | } 76 | 77 | //remove items from the cart 78 | public function removeItem($cartItemId) 79 | { 80 | $cartItem = ShoppingCart::find($cartItemId); 81 | if ($cartItem) { 82 | $cartItem->delete(); 83 | $this->dispatch('cartUpdated'); 84 | } 85 | } 86 | public function render() 87 | { 88 | $this->cartItems = $this->getCartItems(); 89 | $this->calculateTotals(); 90 | 91 | return view('livewire.shopping-cart-component', [ 92 | 'cartItems' => $this->cartItems 93 | ])->title('E-commerce | Shopping cart'); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/Livewire/ShoppingCartIcon.php: -------------------------------------------------------------------------------- 1 | 'updateCartCount', 15 | ]; 16 | 17 | public function mount(){ 18 | $this->updateCartCount(); 19 | } 20 | 21 | public function updateCartCount(){ 22 | //get the count from shopping cart table.. 23 | $this->cartCount = ShoppingCart::where('user_id', Auth::id())->sum('quantity'); 24 | } 25 | public function render() 26 | { 27 | return view('livewire.shopping-cart-icon'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Models/Category.php: -------------------------------------------------------------------------------- 1 | hasMany(Product::class); 17 | } 18 | 19 | public function scopeSearch($query, $value){ 20 | $query->where('name','like',"%{$value}%"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Models/Product.php: -------------------------------------------------------------------------------- 1 | belongsTo(Category::class); 17 | } 18 | 19 | public function scopeSearch($query, $value){ 20 | $query->where('name','like',"%{$value}%") 21 | ->orWhere('description','like',"%{$value}%"); 22 | } 23 | } -------------------------------------------------------------------------------- /app/Models/ShoppingCart.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 22 | } 23 | 24 | public function product() 25 | { 26 | return $this->belongsTo(Product::class); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | protected $fillable = [ 20 | 'name', 21 | 'email', 22 | 'password', 23 | 'role', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * Get the attributes that should be cast. 38 | * 39 | * @return array 40 | */ 41 | protected function casts(): array 42 | { 43 | return [ 44 | 'email_verified_at' => 'datetime', 45 | 'password' => 'hashed', 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withRouting( 10 | web: __DIR__.'/../routes/web.php', 11 | commands: __DIR__.'/../routes/console.php', 12 | health: '/up', 13 | ) 14 | ->withMiddleware(function (Middleware $middleware) { 15 | $middleware->alias([ 16 | 'admin' => AdminMiddleware::class 17 | ]); 18 | }) 19 | ->withExceptions(function (Exceptions $exceptions) { 20 | // 21 | })->create(); 22 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => (bool) env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | the application so that it's available within Artisan commands. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Timezone 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may specify the default timezone for your application, which 63 | | will be used by the PHP date and date-time functions. The timezone 64 | | is set to "UTC" by default as it is suitable for most use cases. 65 | | 66 | */ 67 | 68 | 'timezone' => env('APP_TIMEZONE', 'UTC'), 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Application Locale Configuration 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The application locale determines the default locale that will be used 76 | | by Laravel's translation / localization methods. This option can be 77 | | set to any locale for which you plan to have translation strings. 78 | | 79 | */ 80 | 81 | 'locale' => env('APP_LOCALE', 'en'), 82 | 83 | 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), 84 | 85 | 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Encryption Key 90 | |-------------------------------------------------------------------------- 91 | | 92 | | This key is utilized by Laravel's encryption services and should be set 93 | | to a random, 32 character string to ensure that all encrypted values 94 | | are secure. You should do this prior to deploying the application. 95 | | 96 | */ 97 | 98 | 'cipher' => 'AES-256-CBC', 99 | 100 | 'key' => env('APP_KEY'), 101 | 102 | 'previous_keys' => [ 103 | ...array_filter( 104 | explode(',', env('APP_PREVIOUS_KEYS', '')) 105 | ), 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Maintenance Mode Driver 111 | |-------------------------------------------------------------------------- 112 | | 113 | | These configuration options determine the driver used to determine and 114 | | manage Laravel's "maintenance mode" status. The "cache" driver will 115 | | allow maintenance mode to be controlled across multiple machines. 116 | | 117 | | Supported drivers: "file", "cache" 118 | | 119 | */ 120 | 121 | 'maintenance' => [ 122 | 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), 123 | 'store' => env('APP_MAINTENANCE_STORE', 'database'), 124 | ], 125 | 126 | ]; 127 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => env('AUTH_GUARD', 'web'), 18 | 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | which utilizes session storage plus the Eloquent user provider. 29 | | 30 | | All authentication guards have a user provider, which defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | system used by the application. Typically, Eloquent is utilized. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication guards have a user provider, which defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | system used by the application. Typically, Eloquent is utilized. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | providers to represent the model / table. These providers may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => env('AUTH_MODEL', App\Models\User::class), 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | These configuration options specify the behavior of Laravel's password 80 | | reset functionality, including the table utilized for token storage 81 | | and the user provider that is invoked to actually retrieve users. 82 | | 83 | | The expiry time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | | The throttle setting is the number of seconds a user must wait before 88 | | generating more password reset tokens. This prevents the user from 89 | | quickly generating a very large amount of password reset tokens. 90 | | 91 | */ 92 | 93 | 'passwords' => [ 94 | 'users' => [ 95 | 'provider' => 'users', 96 | 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), 97 | 'expire' => 60, 98 | 'throttle' => 60, 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Password Confirmation Timeout 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Here you may define the amount of seconds before a password confirmation 108 | | window expires and users are asked to re-enter their password via the 109 | | confirmation screen. By default, the timeout lasts for three hours. 110 | | 111 | */ 112 | 113 | 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_STORE', 'database'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "array", "database", "file", "memcached", 30 | | "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'array' => [ 37 | 'driver' => 'array', 38 | 'serialize' => false, 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'connection' => env('DB_CACHE_CONNECTION'), 44 | 'table' => env('DB_CACHE_TABLE', 'cache'), 45 | 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), 46 | 'lock_table' => env('DB_CACHE_LOCK_TABLE'), 47 | ], 48 | 49 | 'file' => [ 50 | 'driver' => 'file', 51 | 'path' => storage_path('framework/cache/data'), 52 | 'lock_path' => storage_path('framework/cache/data'), 53 | ], 54 | 55 | 'memcached' => [ 56 | 'driver' => 'memcached', 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 58 | 'sasl' => [ 59 | env('MEMCACHED_USERNAME'), 60 | env('MEMCACHED_PASSWORD'), 61 | ], 62 | 'options' => [ 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 64 | ], 65 | 'servers' => [ 66 | [ 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 68 | 'port' => env('MEMCACHED_PORT', 11211), 69 | 'weight' => 100, 70 | ], 71 | ], 72 | ], 73 | 74 | 'redis' => [ 75 | 'driver' => 'redis', 76 | 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), 77 | 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | 'octane' => [ 90 | 'driver' => 'octane', 91 | ], 92 | 93 | ], 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Cache Key Prefix 98 | |-------------------------------------------------------------------------- 99 | | 100 | | When utilizing the APC, database, memcached, Redis, and DynamoDB cache 101 | | stores, there might be other applications using the same cache. For 102 | | that reason, you may prefix every cache key to avoid collisions. 103 | | 104 | */ 105 | 106 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 107 | 108 | ]; 109 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'sqlite'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Database Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Below are all of the database connections defined for your application. 27 | | An example configuration is provided for each database system which 28 | | is supported by Laravel. You're free to add / remove connections. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sqlite' => [ 35 | 'driver' => 'sqlite', 36 | 'url' => env('DB_URL'), 37 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 38 | 'prefix' => '', 39 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 40 | 'busy_timeout' => null, 41 | 'journal_mode' => null, 42 | 'synchronous' => null, 43 | ], 44 | 45 | 'mysql' => [ 46 | 'driver' => 'mysql', 47 | 'url' => env('DB_URL'), 48 | 'host' => env('DB_HOST', '127.0.0.1'), 49 | 'port' => env('DB_PORT', '3306'), 50 | 'database' => env('DB_DATABASE', 'laravel'), 51 | 'username' => env('DB_USERNAME', 'root'), 52 | 'password' => env('DB_PASSWORD', ''), 53 | 'unix_socket' => env('DB_SOCKET', ''), 54 | 'charset' => env('DB_CHARSET', 'utf8mb4'), 55 | 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 56 | 'prefix' => '', 57 | 'prefix_indexes' => true, 58 | 'strict' => true, 59 | 'engine' => null, 60 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 61 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 62 | ]) : [], 63 | ], 64 | 65 | 'mariadb' => [ 66 | 'driver' => 'mariadb', 67 | 'url' => env('DB_URL'), 68 | 'host' => env('DB_HOST', '127.0.0.1'), 69 | 'port' => env('DB_PORT', '3306'), 70 | 'database' => env('DB_DATABASE', 'laravel'), 71 | 'username' => env('DB_USERNAME', 'root'), 72 | 'password' => env('DB_PASSWORD', ''), 73 | 'unix_socket' => env('DB_SOCKET', ''), 74 | 'charset' => env('DB_CHARSET', 'utf8mb4'), 75 | 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 76 | 'prefix' => '', 77 | 'prefix_indexes' => true, 78 | 'strict' => true, 79 | 'engine' => null, 80 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 81 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 82 | ]) : [], 83 | ], 84 | 85 | 'pgsql' => [ 86 | 'driver' => 'pgsql', 87 | 'url' => env('DB_URL'), 88 | 'host' => env('DB_HOST', '127.0.0.1'), 89 | 'port' => env('DB_PORT', '5432'), 90 | 'database' => env('DB_DATABASE', 'laravel'), 91 | 'username' => env('DB_USERNAME', 'root'), 92 | 'password' => env('DB_PASSWORD', ''), 93 | 'charset' => env('DB_CHARSET', 'utf8'), 94 | 'prefix' => '', 95 | 'prefix_indexes' => true, 96 | 'search_path' => 'public', 97 | 'sslmode' => 'prefer', 98 | ], 99 | 100 | 'sqlsrv' => [ 101 | 'driver' => 'sqlsrv', 102 | 'url' => env('DB_URL'), 103 | 'host' => env('DB_HOST', 'localhost'), 104 | 'port' => env('DB_PORT', '1433'), 105 | 'database' => env('DB_DATABASE', 'laravel'), 106 | 'username' => env('DB_USERNAME', 'root'), 107 | 'password' => env('DB_PASSWORD', ''), 108 | 'charset' => env('DB_CHARSET', 'utf8'), 109 | 'prefix' => '', 110 | 'prefix_indexes' => true, 111 | // 'encrypt' => env('DB_ENCRYPT', 'yes'), 112 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), 113 | ], 114 | 115 | ], 116 | 117 | /* 118 | |-------------------------------------------------------------------------- 119 | | Migration Repository Table 120 | |-------------------------------------------------------------------------- 121 | | 122 | | This table keeps track of all the migrations that have already run for 123 | | your application. Using this information, we can determine which of 124 | | the migrations on disk haven't actually been run on the database. 125 | | 126 | */ 127 | 128 | 'migrations' => [ 129 | 'table' => 'migrations', 130 | 'update_date_on_publish' => true, 131 | ], 132 | 133 | /* 134 | |-------------------------------------------------------------------------- 135 | | Redis Databases 136 | |-------------------------------------------------------------------------- 137 | | 138 | | Redis is an open source, fast, and advanced key-value store that also 139 | | provides a richer body of commands than a typical key-value system 140 | | such as Memcached. You may define your connection settings here. 141 | | 142 | */ 143 | 144 | 'redis' => [ 145 | 146 | 'client' => env('REDIS_CLIENT', 'phpredis'), 147 | 148 | 'options' => [ 149 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 150 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 151 | ], 152 | 153 | 'default' => [ 154 | 'url' => env('REDIS_URL'), 155 | 'host' => env('REDIS_HOST', '127.0.0.1'), 156 | 'username' => env('REDIS_USERNAME'), 157 | 'password' => env('REDIS_PASSWORD'), 158 | 'port' => env('REDIS_PORT', '6379'), 159 | 'database' => env('REDIS_DB', '0'), 160 | ], 161 | 162 | 'cache' => [ 163 | 'url' => env('REDIS_URL'), 164 | 'host' => env('REDIS_HOST', '127.0.0.1'), 165 | 'username' => env('REDIS_USERNAME'), 166 | 'password' => env('REDIS_PASSWORD'), 167 | 'port' => env('REDIS_PORT', '6379'), 168 | 'database' => env('REDIS_CACHE_DB', '1'), 169 | ], 170 | 171 | ], 172 | 173 | ]; 174 | -------------------------------------------------------------------------------- /config/devdojo/auth/appearance.php: -------------------------------------------------------------------------------- 1 | [ 9 | 'type' => 'svg', 10 | 'image_src' => '', 11 | 'svg_string' => '', 12 | 'height' => '32', 13 | ], 14 | 'background' => [ 15 | 'color' => '#4549bf', 16 | 'image' => '', 17 | 'image_overlay_color' => '#000000', 18 | 'image_overlay_opacity' => '0.5', 19 | ], 20 | 'color' => [ 21 | 'text' => '#212936', 22 | 'button' => '#09090b', 23 | 'button_text' => '#ffffff', 24 | 'input_text' => '', 25 | 'input_border' => '#212936', 26 | ], 27 | 'alignment' => [ 28 | 'heading' => 'center', 29 | 'container' => 'center', 30 | ], 31 | 'favicon' => [ 32 | 'light' => '/auth/img/favicon.png', 33 | 'dark' => '/auth/img/favicon-dark.png', 34 | ], 35 | ]; 36 | -------------------------------------------------------------------------------- /config/devdojo/auth/descriptions.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'redirect_after_auth' => 'Where should the user be redirected to after they are authenticated?', 9 | 'registration_show_password_same_screen' => 'During registrations, show the password on the same screen or show it on an individual screen.', 10 | 'registration_include_name_field' => 'During registration, include the Name field.', 11 | 'registration_include_password_confirmation_field' => 'During registration, include the Password Confirmation field.', 12 | 'registration_require_email_verification' => 'During registration, require users to verify their email.', 13 | 'enable_branding' => 'This will toggle on/off the Auth branding at the bottom of each auth screen. Consider leaving on to support and help grow this project.', 14 | 'dev_mode' => 'This is for development mode, when set in Dev Mode Assets will be loaded from Vite', 15 | 'enable_2fa' => 'Enable the ability for users to turn on Two Factor Authentication', 16 | 'login_show_social_providers' => 'Show the social providers login buttons on the login form', 17 | 'center_align_social_provider_button_content' => 'Center align the content in the social provider button?', 18 | 'social_providers_location' => 'The location of the social provider buttons (top or bottom)', 19 | ], 20 | ]; 21 | -------------------------------------------------------------------------------- /config/devdojo/auth/language.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'page_title' => 'Sign in', 9 | 'headline' => 'Sign in', 10 | 'subheadline' => 'Login to your account below', 11 | 'show_subheadline' => false, 12 | 'email_address' => 'Email Address', 13 | 'password' => 'Password', 14 | 'edit' => 'Edit', 15 | 'button' => 'Continue', 16 | 'forget_password' => 'Forget your password?', 17 | 'dont_have_an_account' => "Don't have an account?", 18 | 'sign_up' => 'Sign up', 19 | 'social_auth_authenticated_message' => 'You have been authenticated via __social_providers_list__. Please login to that network below.', 20 | 'change_email' => 'Change Email', 21 | ], 22 | 'register' => [ 23 | 'page_title' => 'Sign up', 24 | 'headline' => 'Sign up', 25 | 'subheadline' => 'Register for your free account below.', 26 | 'show_subheadline' => false, 27 | 'name' => 'Name', 28 | 'email_address' => 'Email Address', 29 | 'password' => 'Password', 30 | 'password_confirmation' => 'Confirm Password', 31 | 'already_have_an_account' => 'Already have an account?', 32 | 'sign_in' => 'Sign in', 33 | 'button' => 'Continue', 34 | ], 35 | 'verify' => [ 36 | 'page_title' => 'Verify Your Account', 37 | 'headline' => 'Verify your email address', 38 | 'subheadline' => 'Before you can proceed you must verify your email.', 39 | 'show_subheadline' => false, 40 | 'description' => 'Before proceeding, please check your email for a verification link. If you did not receive the email,', 41 | 'new_request_link' => 'click here to request another', 42 | 'new_link_sent' => 'A new link has been sent to your email address.', 43 | 'or' => 'Or', 44 | 'logout' => 'click here to logout', 45 | ], 46 | 'passwordConfirm' => [ 47 | 'page_title' => 'Confirm Your Password', 48 | 'headline' => 'Confirm Password', 49 | 'subheadline' => 'Be sure to confirm your password below', 50 | 'show_subheadline' => false, 51 | 'password' => 'Password', 52 | 'button' => 'Confirm password', 53 | ], 54 | 'passwordResetRequest' => [ 55 | 'page_title' => 'Request a Password Reset', 56 | 'headline' => 'Reset password', 57 | 'subheadline' => 'Enter your email below to reset your password', 58 | 'show_subheadline' => false, 59 | 'email' => 'Email Address', 60 | 'button' => 'Send password reset link', 61 | 'or' => 'or', 62 | 'return_to_login' => 'return to login', 63 | ], 64 | 'passwordReset' => [ 65 | 'page_title' => 'Reset Your Password', 66 | 'headline' => 'Reset Password', 67 | 'subheadline' => 'Reset your password below', 68 | 'show_subheadline' => false, 69 | 'email' => 'Email Address', 70 | 'password' => 'Password', 71 | 'password_confirm' => 'Confirm Password', 72 | 'button' => 'Reset Password', 73 | ], 74 | 'twoFactorChallenge' => [ 75 | 'page_title' => 'Two Factor Challenge', 76 | 'headline_auth' => 'Authentication Code', 77 | 'subheadline_auth' => 'Enter the authentication code provided by your authenticator application.', 78 | 'show_subheadline_auth' => false, 79 | 'headline_recovery' => 'Recovery Code', 80 | 'subheadline_recovery' => 'Please confirm access to your account by entering one of your emergency recovery codes.', 81 | 'show_subheadline_recovery' => false, 82 | ], 83 | 84 | ]; 85 | -------------------------------------------------------------------------------- /config/devdojo/auth/settings.php: -------------------------------------------------------------------------------- 1 | '/', 8 | 'registration_show_password_same_screen' => true, 9 | 'registration_include_name_field' => false, 10 | 'registration_include_password_confirmation_field' => false, 11 | 'registration_require_email_verification' => false, 12 | 'enable_branding' => true, 13 | 'dev_mode' => false, 14 | 'enable_2fa' => false, // Enable or disable 2FA functionality globally 15 | 'login_show_social_providers' => true, 16 | 'center_align_social_provider_button_content' => false, 17 | 'social_providers_location' => 'bottom', 18 | ]; 19 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Below you may configure as many filesystem disks as necessary, and you 24 | | may even configure multiple disks for the same driver. Examples for 25 | | most supported storage drivers are configured here for reference. 26 | | 27 | | Supported drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Deprecations Log Channel 26 | |-------------------------------------------------------------------------- 27 | | 28 | | This option controls the log channel that should be used to log warnings 29 | | regarding deprecated PHP and library features. This allows you to get 30 | | your application ready for upcoming major versions of dependencies. 31 | | 32 | */ 33 | 34 | 'deprecations' => [ 35 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 36 | 'trace' => env('LOG_DEPRECATIONS_TRACE', false), 37 | ], 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Log Channels 42 | |-------------------------------------------------------------------------- 43 | | 44 | | Here you may configure the log channels for your application. Laravel 45 | | utilizes the Monolog PHP logging library, which includes a variety 46 | | of powerful log handlers and formatters that you're free to use. 47 | | 48 | | Available drivers: "single", "daily", "slack", "syslog", 49 | | "errorlog", "monolog", "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 55 | 'stack' => [ 56 | 'driver' => 'stack', 57 | 'channels' => explode(',', env('LOG_STACK', 'single')), 58 | 'ignore_exceptions' => false, 59 | ], 60 | 61 | 'single' => [ 62 | 'driver' => 'single', 63 | 'path' => storage_path('logs/laravel.log'), 64 | 'level' => env('LOG_LEVEL', 'debug'), 65 | 'replace_placeholders' => true, 66 | ], 67 | 68 | 'daily' => [ 69 | 'driver' => 'daily', 70 | 'path' => storage_path('logs/laravel.log'), 71 | 'level' => env('LOG_LEVEL', 'debug'), 72 | 'days' => env('LOG_DAILY_DAYS', 14), 73 | 'replace_placeholders' => true, 74 | ], 75 | 76 | 'slack' => [ 77 | 'driver' => 'slack', 78 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 79 | 'username' => env('LOG_SLACK_USERNAME', 'Laravel Log'), 80 | 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), 81 | 'level' => env('LOG_LEVEL', 'critical'), 82 | 'replace_placeholders' => true, 83 | ], 84 | 85 | 'papertrail' => [ 86 | 'driver' => 'monolog', 87 | 'level' => env('LOG_LEVEL', 'debug'), 88 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 89 | 'handler_with' => [ 90 | 'host' => env('PAPERTRAIL_URL'), 91 | 'port' => env('PAPERTRAIL_PORT'), 92 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 93 | ], 94 | 'processors' => [PsrLogMessageProcessor::class], 95 | ], 96 | 97 | 'stderr' => [ 98 | 'driver' => 'monolog', 99 | 'level' => env('LOG_LEVEL', 'debug'), 100 | 'handler' => StreamHandler::class, 101 | 'formatter' => env('LOG_STDERR_FORMATTER'), 102 | 'with' => [ 103 | 'stream' => 'php://stderr', 104 | ], 105 | 'processors' => [PsrLogMessageProcessor::class], 106 | ], 107 | 108 | 'syslog' => [ 109 | 'driver' => 'syslog', 110 | 'level' => env('LOG_LEVEL', 'debug'), 111 | 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), 112 | 'replace_placeholders' => true, 113 | ], 114 | 115 | 'errorlog' => [ 116 | 'driver' => 'errorlog', 117 | 'level' => env('LOG_LEVEL', 'debug'), 118 | 'replace_placeholders' => true, 119 | ], 120 | 121 | 'null' => [ 122 | 'driver' => 'monolog', 123 | 'handler' => NullHandler::class, 124 | ], 125 | 126 | 'emergency' => [ 127 | 'path' => storage_path('logs/laravel.log'), 128 | ], 129 | 130 | ], 131 | 132 | ]; 133 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'log'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Mailer Configurations 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may configure all of the mailers used by your application plus 25 | | their respective settings. Several examples have been configured for 26 | | you and you are free to add your own as your application requires. 27 | | 28 | | Laravel supports a variety of mail "transport" drivers that can be used 29 | | when delivering an email. You may specify which one you're using for 30 | | your mailers below. You may also add additional mailers if needed. 31 | | 32 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", 33 | | "postmark", "resend", "log", "array", 34 | | "failover", "roundrobin" 35 | | 36 | */ 37 | 38 | 'mailers' => [ 39 | 40 | 'smtp' => [ 41 | 'transport' => 'smtp', 42 | 'url' => env('MAIL_URL'), 43 | 'host' => env('MAIL_HOST', '127.0.0.1'), 44 | 'port' => env('MAIL_PORT', 2525), 45 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 46 | 'username' => env('MAIL_USERNAME'), 47 | 'password' => env('MAIL_PASSWORD'), 48 | 'timeout' => null, 49 | 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url(env('APP_URL', 'http://localhost'), PHP_URL_HOST)), 50 | ], 51 | 52 | 'ses' => [ 53 | 'transport' => 'ses', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), 59 | // 'client' => [ 60 | // 'timeout' => 5, 61 | // ], 62 | ], 63 | 64 | 'resend' => [ 65 | 'transport' => 'resend', 66 | ], 67 | 68 | 'sendmail' => [ 69 | 'transport' => 'sendmail', 70 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 71 | ], 72 | 73 | 'log' => [ 74 | 'transport' => 'log', 75 | 'channel' => env('MAIL_LOG_CHANNEL'), 76 | ], 77 | 78 | 'array' => [ 79 | 'transport' => 'array', 80 | ], 81 | 82 | 'failover' => [ 83 | 'transport' => 'failover', 84 | 'mailers' => [ 85 | 'smtp', 86 | 'log', 87 | ], 88 | ], 89 | 90 | 'roundrobin' => [ 91 | 'transport' => 'roundrobin', 92 | 'mailers' => [ 93 | 'ses', 94 | 'postmark', 95 | ], 96 | ], 97 | 98 | ], 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Global "From" Address 103 | |-------------------------------------------------------------------------- 104 | | 105 | | You may wish for all emails sent by your application to be sent from 106 | | the same address. Here you may specify a name and address that is 107 | | used globally for all emails that are sent by your application. 108 | | 109 | */ 110 | 111 | 'from' => [ 112 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 113 | 'name' => env('MAIL_FROM_NAME', 'Example'), 114 | ], 115 | 116 | ]; 117 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'database'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection options for every queue backend 24 | | used by your application. An example configuration is provided for 25 | | each backend supported by Laravel. You're also free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'connection' => env('DB_QUEUE_CONNECTION'), 40 | 'table' => env('DB_QUEUE_TABLE', 'jobs'), 41 | 'queue' => env('DB_QUEUE', 'default'), 42 | 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), 43 | 'after_commit' => false, 44 | ], 45 | 46 | 'beanstalkd' => [ 47 | 'driver' => 'beanstalkd', 48 | 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), 49 | 'queue' => env('BEANSTALKD_QUEUE', 'default'), 50 | 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), 51 | 'block_for' => 0, 52 | 'after_commit' => false, 53 | ], 54 | 55 | 'sqs' => [ 56 | 'driver' => 'sqs', 57 | 'key' => env('AWS_ACCESS_KEY_ID'), 58 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 59 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 60 | 'queue' => env('SQS_QUEUE', 'default'), 61 | 'suffix' => env('SQS_SUFFIX'), 62 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 63 | 'after_commit' => false, 64 | ], 65 | 66 | 'redis' => [ 67 | 'driver' => 'redis', 68 | 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), 69 | 'queue' => env('REDIS_QUEUE', 'default'), 70 | 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), 71 | 'block_for' => null, 72 | 'after_commit' => false, 73 | ], 74 | 75 | ], 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Job Batching 80 | |-------------------------------------------------------------------------- 81 | | 82 | | The following options configure the database and table that store job 83 | | batching information. These options can be updated to any database 84 | | connection and table which has been defined by your application. 85 | | 86 | */ 87 | 88 | 'batching' => [ 89 | 'database' => env('DB_CONNECTION', 'sqlite'), 90 | 'table' => 'job_batches', 91 | ], 92 | 93 | /* 94 | |-------------------------------------------------------------------------- 95 | | Failed Queue Jobs 96 | |-------------------------------------------------------------------------- 97 | | 98 | | These options configure the behavior of failed queue job logging so you 99 | | can control how and where failed jobs are stored. Laravel ships with 100 | | support for storing failed jobs in a simple file or in a database. 101 | | 102 | | Supported drivers: "database-uuids", "dynamodb", "file", "null" 103 | | 104 | */ 105 | 106 | 'failed' => [ 107 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 108 | 'database' => env('DB_CONNECTION', 'sqlite'), 109 | 'table' => 'failed_jobs', 110 | ], 111 | 112 | ]; 113 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'token' => env('POSTMARK_TOKEN'), 19 | ], 20 | 21 | 'ses' => [ 22 | 'key' => env('AWS_ACCESS_KEY_ID'), 23 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 24 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 25 | ], 26 | 27 | 'resend' => [ 28 | 'key' => env('RESEND_KEY'), 29 | ], 30 | 31 | 'slack' => [ 32 | 'notifications' => [ 33 | 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), 34 | 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), 35 | ], 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'database'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to expire immediately when the browser is closed then you may 31 | | indicate that via the expire_on_close configuration option. 32 | | 33 | */ 34 | 35 | 'lifetime' => env('SESSION_LIFETIME', 120), 36 | 37 | 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Session Encryption 42 | |-------------------------------------------------------------------------- 43 | | 44 | | This option allows you to easily specify that all of your session data 45 | | should be encrypted before it's stored. All encryption is performed 46 | | automatically by Laravel and you may use the session like normal. 47 | | 48 | */ 49 | 50 | 'encrypt' => env('SESSION_ENCRYPT', false), 51 | 52 | /* 53 | |-------------------------------------------------------------------------- 54 | | Session File Location 55 | |-------------------------------------------------------------------------- 56 | | 57 | | When utilizing the "file" session driver, the session files are placed 58 | | on disk. The default storage location is defined here; however, you 59 | | are free to provide another location where they should be stored. 60 | | 61 | */ 62 | 63 | 'files' => storage_path('framework/sessions'), 64 | 65 | /* 66 | |-------------------------------------------------------------------------- 67 | | Session Database Connection 68 | |-------------------------------------------------------------------------- 69 | | 70 | | When using the "database" or "redis" session drivers, you may specify a 71 | | connection that should be used to manage these sessions. This should 72 | | correspond to a connection in your database configuration options. 73 | | 74 | */ 75 | 76 | 'connection' => env('SESSION_CONNECTION'), 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Session Database Table 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When using the "database" session driver, you may specify the table to 84 | | be used to store sessions. Of course, a sensible default is defined 85 | | for you; however, you're welcome to change this to another table. 86 | | 87 | */ 88 | 89 | 'table' => env('SESSION_TABLE', 'sessions'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Session Cache Store 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using one of the framework's cache driven session backends, you may 97 | | define the cache store which should be used to store the session data 98 | | between requests. This must match one of your defined cache stores. 99 | | 100 | | Affects: "apc", "dynamodb", "memcached", "redis" 101 | | 102 | */ 103 | 104 | 'store' => env('SESSION_STORE'), 105 | 106 | /* 107 | |-------------------------------------------------------------------------- 108 | | Session Sweeping Lottery 109 | |-------------------------------------------------------------------------- 110 | | 111 | | Some session drivers must manually sweep their storage location to get 112 | | rid of old sessions from storage. Here are the chances that it will 113 | | happen on a given request. By default, the odds are 2 out of 100. 114 | | 115 | */ 116 | 117 | 'lottery' => [2, 100], 118 | 119 | /* 120 | |-------------------------------------------------------------------------- 121 | | Session Cookie Name 122 | |-------------------------------------------------------------------------- 123 | | 124 | | Here you may change the name of the session cookie that is created by 125 | | the framework. Typically, you should not need to change this value 126 | | since doing so does not grant a meaningful security improvement. 127 | | 128 | */ 129 | 130 | 'cookie' => env( 131 | 'SESSION_COOKIE', 132 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 133 | ), 134 | 135 | /* 136 | |-------------------------------------------------------------------------- 137 | | Session Cookie Path 138 | |-------------------------------------------------------------------------- 139 | | 140 | | The session cookie path determines the path for which the cookie will 141 | | be regarded as available. Typically, this will be the root path of 142 | | your application, but you're free to change this when necessary. 143 | | 144 | */ 145 | 146 | 'path' => env('SESSION_PATH', '/'), 147 | 148 | /* 149 | |-------------------------------------------------------------------------- 150 | | Session Cookie Domain 151 | |-------------------------------------------------------------------------- 152 | | 153 | | This value determines the domain and subdomains the session cookie is 154 | | available to. By default, the cookie will be available to the root 155 | | domain and all subdomains. Typically, this shouldn't be changed. 156 | | 157 | */ 158 | 159 | 'domain' => env('SESSION_DOMAIN'), 160 | 161 | /* 162 | |-------------------------------------------------------------------------- 163 | | HTTPS Only Cookies 164 | |-------------------------------------------------------------------------- 165 | | 166 | | By setting this option to true, session cookies will only be sent back 167 | | to the server if the browser has a HTTPS connection. This will keep 168 | | the cookie from being sent to you when it can't be done securely. 169 | | 170 | */ 171 | 172 | 'secure' => env('SESSION_SECURE_COOKIE'), 173 | 174 | /* 175 | |-------------------------------------------------------------------------- 176 | | HTTP Access Only 177 | |-------------------------------------------------------------------------- 178 | | 179 | | Setting this value to true will prevent JavaScript from accessing the 180 | | value of the cookie and the cookie will only be accessible through 181 | | the HTTP protocol. It's unlikely you should disable this option. 182 | | 183 | */ 184 | 185 | 'http_only' => env('SESSION_HTTP_ONLY', true), 186 | 187 | /* 188 | |-------------------------------------------------------------------------- 189 | | Same-Site Cookies 190 | |-------------------------------------------------------------------------- 191 | | 192 | | This option determines how your cookies behave when cross-site requests 193 | | take place, and can be used to mitigate CSRF attacks. By default, we 194 | | will set this value to "lax" to permit secure cross-site requests. 195 | | 196 | | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value 197 | | 198 | | Supported: "lax", "strict", "none", null 199 | | 200 | */ 201 | 202 | 'same_site' => env('SESSION_SAME_SITE', 'lax'), 203 | 204 | /* 205 | |-------------------------------------------------------------------------- 206 | | Partitioned Cookies 207 | |-------------------------------------------------------------------------- 208 | | 209 | | Setting this value to true will tie the cookie to the top-level site for 210 | | a cross-site context. Partitioned cookies are accepted by the browser 211 | | when flagged "secure" and the Same-Site attribute is set to "none". 212 | | 213 | */ 214 | 215 | 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), 216 | 217 | ]; 218 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class UserFactory extends Factory 13 | { 14 | /** 15 | * The current password being used by the factory. 16 | */ 17 | protected static ?string $password; 18 | 19 | /** 20 | * Define the model's default state. 21 | * 22 | * @return array 23 | */ 24 | public function definition(): array 25 | { 26 | return [ 27 | 'name' => fake()->name(), 28 | 'email' => fake()->unique()->safeEmail(), 29 | 'email_verified_at' => now(), 30 | 'password' => static::$password ??= Hash::make('password'), 31 | 'remember_token' => Str::random(10), 32 | ]; 33 | } 34 | 35 | /** 36 | * Indicate that the model's email address should be unverified. 37 | */ 38 | public function unverified(): static 39 | { 40 | return $this->state(fn (array $attributes) => [ 41 | 'email_verified_at' => null, 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('email')->unique(); 18 | $table->timestamp('email_verified_at')->nullable(); 19 | $table->string('password'); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | 24 | Schema::create('password_reset_tokens', function (Blueprint $table) { 25 | $table->string('email')->primary(); 26 | $table->string('token'); 27 | $table->timestamp('created_at')->nullable(); 28 | }); 29 | 30 | Schema::create('sessions', function (Blueprint $table) { 31 | $table->string('id')->primary(); 32 | $table->foreignId('user_id')->nullable()->index(); 33 | $table->string('ip_address', 45)->nullable(); 34 | $table->text('user_agent')->nullable(); 35 | $table->longText('payload'); 36 | $table->integer('last_activity')->index(); 37 | }); 38 | } 39 | 40 | /** 41 | * Reverse the migrations. 42 | */ 43 | public function down(): void 44 | { 45 | Schema::dropIfExists('users'); 46 | Schema::dropIfExists('password_reset_tokens'); 47 | Schema::dropIfExists('sessions'); 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000001_create_cache_table.php: -------------------------------------------------------------------------------- 1 | string('key')->primary(); 16 | $table->mediumText('value'); 17 | $table->integer('expiration'); 18 | }); 19 | 20 | Schema::create('cache_locks', function (Blueprint $table) { 21 | $table->string('key')->primary(); 22 | $table->string('owner'); 23 | $table->integer('expiration'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down(): void 31 | { 32 | Schema::dropIfExists('cache'); 33 | Schema::dropIfExists('cache_locks'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/0001_01_01_000002_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('queue')->index(); 17 | $table->longText('payload'); 18 | $table->unsignedTinyInteger('attempts'); 19 | $table->unsignedInteger('reserved_at')->nullable(); 20 | $table->unsignedInteger('available_at'); 21 | $table->unsignedInteger('created_at'); 22 | }); 23 | 24 | Schema::create('job_batches', function (Blueprint $table) { 25 | $table->string('id')->primary(); 26 | $table->string('name'); 27 | $table->integer('total_jobs'); 28 | $table->integer('pending_jobs'); 29 | $table->integer('failed_jobs'); 30 | $table->longText('failed_job_ids'); 31 | $table->mediumText('options')->nullable(); 32 | $table->integer('cancelled_at')->nullable(); 33 | $table->integer('created_at'); 34 | $table->integer('finished_at')->nullable(); 35 | }); 36 | 37 | Schema::create('failed_jobs', function (Blueprint $table) { 38 | $table->id(); 39 | $table->string('uuid')->unique(); 40 | $table->text('connection'); 41 | $table->text('queue'); 42 | $table->longText('payload'); 43 | $table->longText('exception'); 44 | $table->timestamp('failed_at')->useCurrent(); 45 | }); 46 | } 47 | 48 | /** 49 | * Reverse the migrations. 50 | */ 51 | public function down(): void 52 | { 53 | Schema::dropIfExists('jobs'); 54 | Schema::dropIfExists('job_batches'); 55 | Schema::dropIfExists('failed_jobs'); 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /database/migrations/2024_04_24_000001_add_user_social_provider_table.php: -------------------------------------------------------------------------------- 1 | foreignId('user_id')->constrained()->onDelete('cascade'); 16 | $table->string('provider_slug'); // maps to providers slug in the devdojo.auth.providers 17 | 18 | $table->string('provider_user_id'); 19 | $table->string('nickname')->nullable(); 20 | $table->string('name')->nullable(); 21 | $table->string('email')->nullable(); 22 | $table->string('avatar')->nullable(); 23 | $table->text('provider_data')->nullable(); // JSON data containing additional provider data we want to include 24 | 25 | $table->string('token'); 26 | $table->string('refresh_token')->nullable(); 27 | $table->timestamp('token_expires_at')->nullable(); 28 | $table->timestamps(); 29 | 30 | $table->primary(['user_id', 'provider_slug']); 31 | }); 32 | } 33 | 34 | /** 35 | * Reverse the migrations. 36 | */ 37 | public function down(): void 38 | { 39 | Schema::dropIfExists('social_provider_user'); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /database/migrations/2024_04_24_000002_update_passwords_field_to_be_nullable.php: -------------------------------------------------------------------------------- 1 | string('password')->nullable()->change(); 17 | $table->string('name')->nullable()->change(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down() 25 | { 26 | // Update records with NULL values to avoid constraint violations 27 | DB::table('users')->whereNull('name')->update(['name' => '']); 28 | DB::table('users')->whereNull('password')->update(['password' => '']); 29 | 30 | // Change the table structure 31 | Schema::table('users', function (Blueprint $table) { 32 | $table->string('name')->nullable(false)->change(); 33 | $table->string('password')->nullable(false)->change(); 34 | }); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2024_05_07_000003_add_two_factor_auth_columns.php: -------------------------------------------------------------------------------- 1 | text('two_factor_secret') 18 | ->after('password') 19 | ->nullable(); 20 | } 21 | 22 | if (! Schema::hasColumn('users', 'two_factor_recovery_codes')) { 23 | $table->text('two_factor_recovery_codes') 24 | ->after('two_factor_secret') 25 | ->nullable(); 26 | } 27 | 28 | if (! Schema::hasColumn('users', 'two_factor_confirmed_at')) { 29 | $table->timestamp('two_factor_confirmed_at') 30 | ->after('two_factor_recovery_codes') 31 | ->nullable(); 32 | } 33 | 34 | }); 35 | } 36 | 37 | /** 38 | * Reverse the migrations. 39 | */ 40 | public function down(): void 41 | { 42 | Schema::table('users', function (Blueprint $table) { 43 | $table->dropColumn([ 44 | 'two_factor_secret', 45 | 'two_factor_recovery_codes', 46 | 'two_factor_confirmed_at', 47 | ]); 48 | }); 49 | } 50 | }; 51 | -------------------------------------------------------------------------------- /database/migrations/2024_07_25_171025_add_role_column_to_users_table.php: -------------------------------------------------------------------------------- 1 | integer('role')->default(0); //0 - users/ customer & 1 for our admin 16 | }); 17 | } 18 | 19 | /** 20 | * Reverse the migrations. 21 | */ 22 | public function down(): void 23 | { 24 | Schema::table('users', function (Blueprint $table) { 25 | $table->dropColumn('role'); 26 | }); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2024_07_25_171145_create_categories_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->timestamps(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('categories'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2024_07_25_214115_create_products_table.php: -------------------------------------------------------------------------------- 1 | id(); 17 | $table->foreignId('category_id')->constrained()->onDelete('cascade'); 18 | $table->string('name'); 19 | $table->text('description')->nullable(); 20 | $table->decimal('price', 8, 2); 21 | $table->string('image')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('products'); 32 | } 33 | }; -------------------------------------------------------------------------------- /database/migrations/2024_08_01_133930_create_shopping_carts_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->unsignedBigInteger('user_id'); 17 | $table->unsignedBigInteger('product_id'); 18 | $table->integer('quantity')->default(1); 19 | $table->timestamps(); 20 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); 21 | $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade'); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('shopping_carts'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 17 | 18 | User::factory()->create([ 19 | 'name' => 'Test User', 20 | 'email' => 'test@example.com', 21 | ]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "devDependencies": { 9 | "autoprefixer": "^10.4.19", 10 | "axios": "^1.6.4", 11 | "laravel-vite-plugin": "^1.0", 12 | "postcss": "^8.4.39", 13 | "tailwindcss": "^3.4.6", 14 | "vite": "^5.0" 15 | }, 16 | "dependencies": { 17 | "preline": "^2.4.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | tests/Unit 10 | 11 | 12 | tests/Feature 13 | 14 | 15 | 16 | 17 | app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/auth/app.css: -------------------------------------------------------------------------------- 1 | #auth-body{ 2 | opacity:80; 3 | } 4 | 5 | #auth-container{ 6 | border:0px !important; 7 | } 8 | 9 | #auth-heading-container{ 10 | padding-left:5px; 11 | } -------------------------------------------------------------------------------- /public/auth/build/assets/scripts.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/auth/build/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources/css/auth.css": { 3 | "file": "assets/styles.css", 4 | "src": "resources/css/auth.css", 5 | "isEntry": true 6 | }, 7 | "resources/js/auth.js": { 8 | "file": "assets/scripts.js", 9 | "name": "scripts", 10 | "src": "resources/js/auth.js", 11 | "isEntry": true 12 | } 13 | } -------------------------------------------------------------------------------- /public/auth/img/favicon-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadrackjm/minimal-ecommerce-tall-stack/dea9411c8a2b4af357e2da55c7d20d52e4645a81/public/auth/img/favicon-dark.png -------------------------------------------------------------------------------- /public/auth/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadrackjm/minimal-ecommerce-tall-stack/dea9411c8a2b4af357e2da55c7d20d52e4645a81/public/auth/img/favicon.ico -------------------------------------------------------------------------------- /public/auth/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadrackjm/minimal-ecommerce-tall-stack/dea9411c8a2b4af357e2da55c7d20d52e4645a81/public/auth/img/favicon.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadrackjm/minimal-ecommerce-tall-stack/dea9411c8a2b4af357e2da55c7d20d52e4645a81/public/favicon.ico -------------------------------------------------------------------------------- /public/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadrackjm/minimal-ecommerce-tall-stack/dea9411c8a2b4af357e2da55c7d20d52e4645a81/public/images/1.jpg -------------------------------------------------------------------------------- /public/images/placeholder-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shadrackjm/minimal-ecommerce-tall-stack/dea9411c8a2b4af357e2da55c7d20d52e4645a81/public/images/placeholder-image.jpg -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handleRequest(Request::capture()); 18 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | /* width */ 6 | ::-webkit-scrollbar { 7 | width: 10px; 8 | } 9 | 10 | /* Track */ 11 | ::-webkit-scrollbar-track { 12 | background: #eee7e7; 13 | } 14 | 15 | /* Handle */ 16 | ::-webkit-scrollbar-thumb { 17 | background: #4031cc; 18 | border-radius: 5px; 19 | } 20 | 21 | /* Handle on hover */ 22 | ::-webkit-scrollbar-thumb:hover { 23 | background: #3010bd; 24 | } -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | import 'preline' -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | window.axios = axios; 3 | 4 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 5 | -------------------------------------------------------------------------------- /resources/views/admin-layout.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ $title ?? 'Page Title' }} 8 | @vite('resources/css/app.css') 9 | @vite('resources/js/app.js') 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 21 | 22 | 23 | 24 |
    25 |
  1. 26 | Application Layout 27 | 28 | 29 | 30 |
  2. 31 |
  3. 32 | Dashboard 33 |
  4. 34 |
35 | 36 |
37 |
38 | 39 | 40 | 41 | 107 | 108 | 109 | 110 |
111 | {{ $slot }} 112 |
113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /resources/views/components/categories.blade.php: -------------------------------------------------------------------------------- 1 | 2 | {{-- {!! $icon !!} --}} 3 | {{ $categoryName }} 4 | -------------------------------------------------------------------------------- /resources/views/components/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ $title ?? 'Page Title' }} 8 | @vite('resources/css/app.css') 9 | @vite('resources/js/app.js') 10 | 11 | 12 | 13 | {{ $slot }} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /resources/views/components/navigation/view-all.blade.php: -------------------------------------------------------------------------------- 1 |
2 |

{{ $Category }}

3 | 4 | View all 5 | 6 | 7 | 8 | 9 |
-------------------------------------------------------------------------------- /resources/views/components/search-component.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 | 6 |
7 | 8 |
9 |
10 |
11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 |
19 |
20 |
21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 39 | 40 |
41 | 42 |
43 | @foreach ($categories as $category) 44 | @include('components.categories',[ 45 | 'categoryName' => $category->name, 46 | 'category_id' => $category->id 47 | // 'icon' => '' 48 | ]) 49 | @endforeach 50 |
51 |
52 |
53 |
54 | -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ $title ?? 'Page Title' }} 8 | @vite('resources/css/app.css') 9 | @vite('resources/js/app.js') 10 | 11 | 12 |
13 | 14 |
15 | 18 |
19 | 20 | 21 | 22 |
23 |
24 |

404

25 |

Oops, something went wrong.

26 |

Sorry, we couldn't find your page.

27 | 33 |
34 |
35 | 36 | 37 | 38 |
39 |
40 |

© All Rights Reserved. 2022.

41 |
42 |
43 | 44 |
45 | 46 | -------------------------------------------------------------------------------- /resources/views/livewire/about-us.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | Features Image 4 | 5 | 6 |
7 |
8 |

9 | We tackle the challenges start-ups face 10 |

11 |

12 | Besides working with start-up enterprises as a partner for digitalization, we have built enterprise products for common pain points that we have encountered in various products and projects. 13 |

14 |
15 | 16 | 17 |
18 |
19 | 20 |
21 | 22 |
23 |

24 | Creative minds 25 |

26 |

27 | We choose our teams carefully. Our people are the secret to great work. 28 |

29 |
30 |
31 | 32 | 33 | 34 |
35 | 36 |
37 |

38 | Simple and affordable 39 |

40 |

41 | From boarding passes to movie tickets, there's pretty much nothing you can't store with Preline. 42 |

43 |
44 |
45 | 46 | 47 | 48 |
49 | 50 |
51 |

52 | Industry-leading documentation 53 |

54 |

55 | Our documentation and extensive Client libraries contain everything a business needs to build a custom integration. 56 |

57 |
58 |
59 | 60 | 61 | 62 |
63 | 64 |
65 |

66 | Designing for people 67 |

68 |

69 | We actively pursue the right balance between functionality and aesthetics, creating delightful experiences. 70 |

71 |
72 |
73 | 74 |
75 |
76 | 77 |
78 | 79 |
80 | -------------------------------------------------------------------------------- /resources/views/livewire/add-category.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |

12 | Add New Category 13 |

14 |
15 | 16 | 17 |
18 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | @error('category_name') {{ $message }} @enderror 28 |
29 |
30 | 31 |
32 | 33 | 34 | 40 |
41 |
42 | 43 |
44 | 45 |
46 | -------------------------------------------------------------------------------- /resources/views/livewire/add-product-form.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |

12 | Add New Product 13 |

14 |
15 | 16 | 17 |
18 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | @error('product_name') {{ $message }} @enderror 28 |
29 |
30 | 31 | 32 |
33 | 36 |
37 | 38 | 39 |
40 | 41 | @error('product_price') {{ $message }} @enderror 42 |
43 | 44 | 45 |
46 | 49 |
50 | 51 | 52 |
53 | 60 | @error('category_id') {{ $message }} @enderror 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 |

70 | More Details 71 |

72 |
73 | 74 |
75 | 76 |
77 | 78 | 79 |
80 | @if ($photo) 81 | Product image 82 | @else 83 | default image 84 | @endif 85 |
86 | 87 |
88 | 91 |
92 | 93 | 94 |
95 | 96 | 97 | @error('photo') {{ $message }} @enderror 98 | 99 |
100 | 101 |
102 |
103 |
104 |
105 |
106 | 107 |
108 |
109 | 110 |
111 | 112 |
113 | 114 |
115 |
116 | 119 |
120 |
121 | 122 | 123 |
124 | 125 | @error('product_description') {{ $message }} @enderror 126 |
127 | 128 |
129 | 130 | 136 |
137 |
138 | 139 |
140 | 141 |
142 | -------------------------------------------------------------------------------- /resources/views/livewire/admin-dashboard.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /resources/views/livewire/all-products.blade.php: -------------------------------------------------------------------------------- 1 |
2 |

All Products

3 | 4 | @php 5 | $all = 'all'; 6 | @endphp 7 | 8 |
9 | -------------------------------------------------------------------------------- /resources/views/livewire/bread-crumb.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/livewire/contacts.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |

6 | Contact us 7 |

8 |

9 | Tell us your story and we’ll be in touch. 10 |

11 |
12 | 13 |
14 | 15 |
16 |
17 | 18 |
19 |
20 | 21 | 22 |
23 | 24 |
25 | 26 | 27 |
28 |
29 | 30 | 31 |
32 | 33 | 34 |
35 | 36 | 37 |
38 |
39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 |
47 |
48 | 49 | 50 |
51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 |
59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 67 | 68 |
69 | 70 |
71 | 72 |
73 |

74 | We'll get back to you in 1-2 business days. 75 |

76 |
77 |
78 | 79 |
80 |
81 |
82 | -------------------------------------------------------------------------------- /resources/views/livewire/edit-product.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{-- --}} 3 | 4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 |

12 | Edit Product Details 13 |

14 |
15 | 16 | 17 |
18 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | @error('product_name') {{ $message }} @enderror 28 |
29 |
30 | 31 | 32 |
33 | 36 |
37 | 38 | 39 |
40 | 41 | @error('product_price') {{ $message }} @enderror 42 |
43 | 44 | 45 |
46 | 49 |
50 | 51 | 52 |
53 | 60 | @error('category_id') {{ $message }} @enderror 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 |
69 |

70 | More Details 71 |

72 |
73 | 74 |
75 | 76 |
77 | 78 | 79 |
80 | @if ($photo && is_string($photo)) 81 | Product image 82 | @elseif ($photo) 83 | Product image 84 | @else 85 | default image 86 | @endif 87 |
88 | 89 |
90 | 93 |
94 | 95 | 96 |
97 | 98 | 99 | @error('photo') {{ $message }} @enderror 100 | 101 |
102 | 103 |
104 |
105 |
106 |
107 |
108 | 109 |
110 |
111 | 112 |
113 | 114 |
115 | 116 |
117 |
118 | 121 |
122 |
123 | 124 | 125 |
126 | 127 | @error('product_description') {{ $message }} @enderror 128 |
129 | 130 |
131 | 132 | 138 |
139 |
140 | 141 |
142 | 143 |
144 | -------------------------------------------------------------------------------- /resources/views/livewire/header.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | Home 5 | 6 | 10 | 11 | 12 | 13 |
14 | 32 | 33 |
34 |
35 | @if (auth()->check()) 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | @else 44 | 48 | Get Started 49 | 50 | @endif 51 | 52 |
53 | 54 | 69 |
70 |
71 |
72 |
-------------------------------------------------------------------------------- /resources/views/livewire/hero-section.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

5 | Online Marketplace 6 | Discover Quality Products Online Now. 7 |

8 | 9 |

10 | Browse our collection of high-quality products and enjoy seamless online shopping. 11 |

12 | 13 |
14 | @if (auth()->check()) 15 | 19 | Redeem your offer Now! 20 | 21 | @else 22 | 26 | Get Started 27 | 28 | @endif 29 | 30 | 31 | 35 | Explore More 36 | 37 |
38 |
39 |
40 |
-------------------------------------------------------------------------------- /resources/views/livewire/item-card.blade.php: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /resources/views/livewire/manage-categories.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 |
7 |
8 |
9 |
10 | 11 |
12 |
13 |

14 | category 15 |

16 |

17 | Add category, edit and more. 18 |

19 |
20 | 21 |
22 |
23 | 24 |
25 | 26 | 27 | 28 | Add category 29 | 30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | @include('livewire.theaders.th',[ 40 | 'name' => 'name', 41 | 'columnName' => 'category Name', 42 | ]) 43 | 44 | @include('livewire.theaders.th',[ 45 | 'name' => 'created_at', //column name from db 46 | 'columnName' => 'Created', //display name 47 | ]) 48 | 49 | 50 | 51 | 52 | 53 | 54 | @if (count($categories) > 0) 55 | @foreach ($categories as $category) 56 | 57 | 65 | 70 | 77 | 84 | 85 | @endforeach 86 | @else 87 | 88 | 95 | 96 | @endif 97 | 98 |
58 |
59 |
60 | {{str($category->name)->words(3)}} 61 |
62 | 63 |
64 |
66 |
67 | {{ date('D M Y, H:i',strtotime($category->created_at))}} 68 |
69 |
71 | 76 | 78 | 83 |
89 |
90 | 91 | No Data Found! 92 | 93 |
94 |
99 | 100 | 101 | 102 |
103 |
104 | 105 | 113 |
114 | 115 |
116 | {{ $categories->links()}} 117 |
118 | 119 |
120 | 121 |
122 |
123 |
124 |
125 | 126 |
127 |
128 | 129 | -------------------------------------------------------------------------------- /resources/views/livewire/manage-orders.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Manage Orders 3 | {{-- Care about people's approval and you will be their prisoner. --}} 4 |
5 | -------------------------------------------------------------------------------- /resources/views/livewire/manage-product.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /resources/views/livewire/product-details.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | product-images 4 |
5 |

{{ $product->name }}

6 |

{{ $product->description }}

7 |
8 |
9 |

{{ $product->category->name }}

10 |
11 |

${{ $product->price }}

12 |
13 |
14 | @if (auth()->check()) 15 | 23 | @else 24 | 25 |
26 | 27 | 28 | 29 | Add to cart 30 |
31 |
32 | @endif 33 |
34 |
35 |
36 |
37 |

Related Products

38 | 39 |
40 |
41 | -------------------------------------------------------------------------------- /resources/views/livewire/product-listing.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @if (Request::is('all/products') || Request::is('livewire/update')) 3 | @include('components.search-component') 4 | @endif 5 |
6 | @if (count($products)> 0) 7 | @foreach ($products as $product) 8 | 9 | @endforeach 10 | @else 11 |

No Product Available

12 | @endif 13 | 14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /resources/views/livewire/product-section.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | @include('components.navigation.view-all',[ 4 | 'Category' => 'Brand New' 5 | ]) 6 | 7 | 8 | 9 | @include('components.navigation.view-all',[ 10 | 'Category' => 'Digital Products' 11 | ]) 12 | 13 | 14 | 15 | @include('components.navigation.view-all',[ 16 | 'Category' => 'Fashion and Apparel' 17 | ]) 18 | 19 | 20 |
-------------------------------------------------------------------------------- /resources/views/livewire/product-table.blade.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 |
7 |
8 |
9 |
10 | 11 |
12 |
13 |

14 | Product 15 |

16 |

17 | Add Product, edit and more. 18 |

19 |
20 | 21 |
22 |
23 | 24 |
25 | 26 | 27 | 28 | Add Product 29 | 30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | @include('livewire.theaders.th',[ 40 | 'name' => 'name', 41 | 'columnName' => 'Product Name', 42 | ]) 43 | 44 | @include('livewire.theaders.th',[ 45 | 'name' => 'description', //column name from db 46 | 'columnName' => 'Description', //display name 47 | ]) 48 | 49 | @include('livewire.theaders.th',[ 50 | 'name' => 'price', //column name from db 51 | 'columnName' => 'Price', //display name 52 | ]) 53 | 54 | @include('livewire.theaders.th',[ 55 | 'name' => 'category_id', //column name from db 56 | 'columnName' => 'Category', //display name 57 | ]) 58 | 59 | @include('livewire.theaders.th',[ 60 | 'name' => 'created_at', //column name from db 61 | 'columnName' => 'Created', //display name 62 | ]) 63 | 64 | 65 | 66 | 67 | 68 | 69 | @if (count($products) > 0) 70 | @foreach ($products as $product) 71 | 72 | 86 | 91 | 98 | 105 | 110 | 117 | 124 | 125 | @endforeach 126 | @else 127 | 128 | 135 | 136 | @endif 137 | 138 |
73 | 85 | 87 |
88 | {{ str($product->description)->words(8)}} 89 |
90 |
92 |
93 | 94 | ${{$product->price}} 95 | 96 |
97 |
99 |
100 | 101 | {{$product->category->name}} 102 | 103 |
104 |
106 |
107 | {{ date('D M Y, H:i',strtotime($product->created_at))}} 108 |
109 |
111 |
112 | 113 | Edit 114 | 115 |
116 |
118 | 123 |
129 |
130 | 131 | No Data Found! 132 | 133 |
134 |
139 | 140 | 141 | 142 |
143 |
144 | 145 | 153 |
154 | 155 |
156 | {{ $products->links()}} 157 |
158 | 159 |
160 | 161 |
162 |
163 |
164 |
165 | 166 |
167 |
168 | 169 | -------------------------------------------------------------------------------- /resources/views/livewire/shopping-cart-component.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

Your Cart

6 |
7 | Loading... 8 |
9 |
10 | 11 |
12 |
    13 | @foreach($cartItems as $item) 14 |
  • 15 | 16 | 17 |
    18 |

    {{ $item->product->name }}

    19 |
    20 |
    21 |
    Size:
    22 |
    {{ $item->product->size }}
    23 |
    24 |
    25 |
    Color:
    26 |
    {{ $item->product->color }}
    27 |
    28 |
    29 |
    30 | 31 |
    32 |
    33 | 34 | 35 |
    36 | 37 | 43 |
    44 |
  • 45 | @endforeach 46 |
47 | 48 |
49 |
50 |
51 |
52 |
Subtotal
53 |
${{ $subtotal }}
54 |
55 |
56 |
VAT
57 |
${{ $vat }}
58 |
59 |
60 |
Discount
61 |
-${{ $discount }}
62 |
63 |
64 |
Total
65 |
${{ $total }}
66 |
67 |
68 | 69 |
70 | 71 | 72 | 73 | 74 |

1 Discounts Applied

75 |
76 |
77 | 78 | 88 |
89 |
90 |
91 |
92 | 93 |
-------------------------------------------------------------------------------- /resources/views/livewire/shopping-cart-icon.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ $cartCount }} 7 | 8 | -------------------------------------------------------------------------------- /resources/views/livewire/skeleton/item-skeleton.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 6 |
7 |

8 | 9 |
    10 |
  • 11 |
  • 12 |
13 |
14 |
-------------------------------------------------------------------------------- /resources/views/livewire/theaders/th.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Minimal E-commerce-app 8 | @vite('resources/css/app.css') 9 | @vite('resources/js/app.js') 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 8 | })->purpose('Display an inspiring quote')->hourly(); 9 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('shopping-cart'); 30 | 31 | Route::group(['middleware' => 'admin'], function(){ 32 | Route::get('/admin/dashboard', AdminDashboard::class)->name('dashboard'); 33 | 34 | Route::get('/products',ManageProduct::class)->name('products'); 35 | 36 | Route::get('/orders',ManageOrders::class)->name('orders'); 37 | 38 | Route::get('/add/product', AddProductForm::class); 39 | 40 | Route::get('/manage/categories', ManageCategories::class); 41 | //adding category form 42 | Route::get('/add/category', AddCategory::class); 43 | //editing products 44 | Route::get('/edit/{id}/product', EditProduct::class); 45 | }); 46 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./resources/**/*.blade.php", 5 | "./resources/**/*.js", 6 | "./resources/**/*.vue", 7 | 'node_modules/preline/dist/*.js', 8 | ], 9 | theme: { 10 | extend: {}, 11 | }, 12 | plugins: [ 13 | require('preline/plugin'), 14 | ], 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 16 | 17 | $response->assertStatus(200); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | --------------------------------------------------------------------------------