Laravel CRUD is a simple Laravel-based CRUD (Create, Read, Update, Delete) application, designed to demonstrate basic operations in Laravel. The project allows users to manage records in a database, showcasing essential functionality for managing data using Laravel.
- Create: Add new records with fields for
name
,day
, anddescription
. - Read: View a list of all records stored in the database.
- Update: Modify existing records with validation.
- Delete: Remove records from the database.
The project is styled using Bootstrap to provide a clean, responsive interface.
- Laravel 11.x (Framework)
- PHP 8.2.x
- MySQL (or any database supported by Laravel)
- Bootstrap 5 (for styling)
- Git (for version control)
Before running this project, make sure you have the following installed:
- PHP 8.2 or higher
- Composer
- MySQL or another database system
- Git
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/malikarslanasif131/laravel-curd.git cd laravel-curd
-
Install dependencies: Run the following command to install all required dependencies:
composer install
-
Environment setup: Copy the
.env.example
file to.env
:cp .env.example .env
Open
.env
and update the database configuration to match your local setup:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_username DB_PASSWORD=your_database_password
-
Generate the application key:
php artisan key:generate
-
Run migrations: Run the following command to create the necessary tables in the database:
php artisan migrate
-
Run the development server: Start the application by running:
php artisan serve
Visit
http://127.0.0.1:8000
in your browser to access the application.
Once the application is running, you can:
- Add new records by navigating to
/add
. - View all records on the homepage.
- Edit records by clicking the "Edit" link next to each record.
- Delete records by clicking the "Delete" link next to each record.
This application includes validation for input fields using Laravel’s built-in validation functionality. The form fields will display Bootstrap-styled validation error messages if the inputs are invalid.
If you'd like to contribute to this project:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is open-sourced software licensed under the MIT license.