A Medium-like blogging platform built with Laravel 12, featuring article publishing, user authentication, and media management.
- PHP 8.2 or higher
- Composer
- Node.js 18+ and npm
- SQLite (default) or MySQL/PostgreSQL
-
Make sure you have a
.env
file with your environment variables, and Docker up and running: -
Build and start the services:
touch database/database.sqlite
php artisan migrate --force
php artisan db:seed --force
npm install && npm run build
docker-compose build --no-cache && docker-compose up -d
This will build the Docker image if needed and start the containers.
>> Web App - Blog http://localhost:8000/ Name: Jane Doe user: jane@acme.com pwd: password Name: John Doe user: john@acme.com pwd: password >> MinIO http://127.0.0.1:9090/login user: minioadmin pwd: minioadmin >> Mailpit http://localhost:8025/
-
To stop the services:
docker-compose down
-
Clone the repository:
git clone https://github.com/yourusername/laravel-medium-clone.git cd laravel-medium-clone
-
Install PHP dependencies:
composer install
-
Install JavaScript dependencies:
npm install
-
Build JavaScript dependencies:
npm run build
-
Copy the environment file:
cp .env.example .env
-
Generate application key:
php artisan key:generate
The project is configured to use SQLite by default:
- First, ensure your file has the correct database configuration:
.env
DB_CONNECTION=sqlite
DB_DATABASE=/absolute/path/to/your/project/database/database.sqlite
Note: You can remove other DB_* variables (DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD) as they're not needed for SQLite.
-
Create the SQLite database file:
touch database/database.sqlite
-
Run migrations:
php artisan migrate
-
(Optional) Seed the database with sample data:
php artisan db:seed
If you want to start fresh at any point, you can use:
php artisan migrate:fresh
This will drop all tables and re-run all migrations. Add --seed
flag if you want to reseed the database:
php artisan migrate:fresh --seed
You can run the application using the custom dev script that starts the Laravel server, queue worker, and Vite development server concurrently:
composer dev
Or run each service separately:
-
Start the Laravel development server:
php artisan serve
-
Start the queue worker:
php artisan queue:listen
-
Compile assets with Vite:
npm run dev
The application will be available at http://localhost:8000
This project uses PestPHP for testing. To run the tests:
php artisan test
Or to run tests with Pest directly:
./vendor/bin/pest
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.
If you don't feel like reading, Laracasts can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Partners program.
- Vehikl
- Tighten Co.
- WebReinvent
- Kirschbaum Development Group
- 64 Robots
- Curotec
- Cyber-Duck
- DevSquad
- Jump24
- Redberry
- Active Logic
- byte5
- OP.GG
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.
The Laravel framework is open-sourced software licensed under the MIT license.