A Laravel-based web application for managing and sharing recipes with full user authentication, CRUD operations, reviews, image uploads, and more. This app is built using Laravel with MongoDB as the backend database using the query builder.
- User registration and login/logout using sessions
- Custom authentication logic using Laravel’s Query Builder
- Middleware to protect routes and restrict unauthenticated access
- Create, read, update, and delete (CRUD) recipes
- Upload and store recipe images with validation
- Display recipes in a paginated format on the homepage
- Each recipe includes title, description, ingredients, and image
- Logged-in users can leave reviews on recipes
- Each review includes a rating and comment
- Reviews are linked to users and recipes
- MongoDB collection used to manage reviews separately
- Admin can manage (CRUD) user accounts
- Fields: name, email, and hashed password
- Passwords stored securely using bcrypt hashing
- Logged-in users can change their password
- Change password form includes: old password, new password, confirm password
- Validation checks ensure old password matches before updating
- Helper function
auth_user()
to easily access session user data in views and controllers - Middleware for route protection
- Flash messages for success/error handling
- Framework: Laravel
- Database: MongoDB (via
jenssegers/laravel-mongodb
package) - Frontend: Blade templates, Bootstrap (optional)
- Session: Laravel Session for user login tracking
- Image Uploads: Laravel file system
routes/web.php
– All routes defined hereapp/Http/Controllers
– Controllers for Recipes, Users, Reviewsresources/views
– Blade templates for frontendpublic/uploads
– Stores uploaded recipe images
- PHP 8+
- Composer
- Laravel 10+
- MongoDB server
- Node.js (optional for compiling assets)
git clone https://github.com/your-username/recipe-app.git
cd recipe-app
composer install
cp .env.example .env
php artisan key:generate
Configure your MongoDB connection in .env
:
DB_CONNECTION=mongodb
DB_HOST=127.0.0.1
DB_PORT=27017
DB_DATABASE=your_db_name
Serve the project:
php artisan serve
Feel free to fork this repository and improve the app. Pull requests are welcome!
This project is open-sourced under the MIT License.