A simple and beautiful Laravel web application built using the Model-View-Controller (MVC) pattern.
This project demonstrates clean routing, Blade templates, and form handling with database storage.
- π Home, βΉοΈ About, and π© Contact pages
- π¨ Beautiful modern UI with gradient design
- π§ Follows Laravel MVC architecture
- π Contact form with validation and database storage
- β‘ Flash messages for success and validation errors
- πΎ Data stored using Eloquent ORM (
Messagemodel)
- Framework: Laravel 11+
- Language: PHP 8+
- Database: MySQL
- Frontend: Blade, HTML5, CSS3 (custom)
- Icons: Material Design Icons (MDI)
simpleApp/ β βββ app/ β βββ Http/ β β βββ Controllers/ β β βββ PageController.php β β βββ ContactController.php β βββ Models/ β βββ Message.php β βββ database/ β βββ migrations/ β βββ create_messages_table.php β βββ resources/ β βββ views/ β βββ home.blade.php β βββ about.blade.php β βββ contact.blade.php β βββ routes/ β βββ web.php β βββ .env.example
yaml Copy code
git clone https://github.com/yourusername/laravel-mvc-contact-app.git cd laravel-mvc-contact-app 2οΈβ£ Install Dependencies bash Copy code composer install 3οΈβ£ Setup Environment Copy .env.example to .env and update database info:
cp .env.example .env php artisan key:generate Edit .env:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel_mvc_app DB_USERNAME=root DB_PASSWORD= 4οΈβ£ Run Migrations
php artisan migrate 5οΈβ£ Start the Server
php artisan serve Visit the app at π http://127.0.0.1:8000
π¬ Contact Form Functionality Submits data via POST /contact
Validates inputs (name, email, message)
Stores in messages table
Displays success message after submission
Shows validation errors if inputs are invalid
πΈ Screenshots
Home
About
Contact
π§βπ» Author Muhammad Sohail π Rawalpindi, Pakistan π§ sohailqureshii369@gmail.com π LinkedIn