Skip to content

dhananjaysawant/php-laravel-mysql-queries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

PHP + Laravel MySQL Queries (Simple → Complex)

Repository demonstrating MySQL queries in:

  • Laravel (migrations, models, query builder, Eloquent)
  • Plain PHP examples (PDO) for quick reference

Author: DhananjaySawant

Structure

php-laravel-mysql-queries/
├── README.md
├── .gitignore
├── php/
│   ├── db_connection.php
│   ├── 01_basic_queries.php
│   ├── 02_joins.php
│   ├── 03_aggregate.php
│   ├── 04_subqueries.php
│   └── 05_advanced.php
└── laravel/
    ├── app/
    │   ├── Models/
    │   │   ├── Employee.php
    │   │   └── Project.php
    │   └── Repositories/
    │       ├── EmployeeRepository.php
    │       └── ComplexQueryRepository.php
    ├── database/
    │   └── migrations/
    │       ├── 2025_10_30_000000_create_employees_table.php
    │       └── 2025_10_30_000001_create_projects_table.php
    └── routes/
        └── web.php

Quick start (Laravel)

  1. Copy the laravel folder into a fresh Laravel project (or adapt files into your project).
  2. Run migrations:
php artisan migrate
  1. Visit the example route:
/employees/projects

Quick start (PHP examples)

Open php/db_connection.php and configure credentials, then run the example scripts using PHP CLI or in a PHP server.


If you want, I can:

  • Customize the README with your GitHub username or project description.
  • Add seeders / factories for Laravel.
  • Create a GitHub repo and push it (I'll give you instructions / commands).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages