Skip to content

offline-agency/laravel-mongodb-blog

Repository files navigation

A Demo Blog made with MongoDB and Laravel

This repository is an example implementation of a Blog based on Laravel and MongoDB

Installation

Dependencies

Laravel

Mongo Auto Sync

Clone repo

git@github.com:offline-agency/laravel-mongodb-blog.git

Enter folder

cd laravel-mongodb-blog

Install Dependencies

composer install
npm install
npm run dev

Configuration

Generate .env file

cp .env.example .env

Generate APP_KEY

php artisan key:generate

Database

# Add parameters into .env file
MONGO_HOST=127.0.0.1
MONGO_PORT=29939
MONGO_DATABASE=laravel
MONGO_USERNAME=root
MONGO_PASSWORD=
MONGO_DB_AUTH=laravel
MONGO_OPTION_NAME=database

# Run
php artisan config:clear

Run

# Migration (not needed)
php artisan migrate

# Seeder
php artisan db:seed

Features

Frontend

  • Home Last Article with standard Laravel simple pagination
  • Category List paginated with standard Laravel simple pagination
  • Article Detail
  • Category Detail with associated articles paginated with standard Laravel simple pagination

Command

  • php artisan drop:collection {collection_name} (Example for Destroy with sync)

Seeder

  • Seeding Users, Articles & Categories (Example for Create with sync)

Admin panel

  • CRUD operations for articles on backend panel [TODO]
  • CRUD operations for categories on backend panel [TODO]
  • CRUD operations for users on backend panel [TODO]

Others

  • (Slow) Write operation runs on background job [TODO]
  • Benchmark Test MongoDB vs MySQL [TODO]
  • PHPUnit Test [TODO]

Screenshots

Home Last Article

Home Last Article

Category List

Category List

Category Detail

Category Detail

Article Detail

Home Last Article

Login (test@test.com/demo)

Login

Dashboard

Dashboard

Testing

Run the test with:

composer test

Contributing

Please see Contributing for details

Security

If you discover any security-related issues, please email support@offlineagency.com instead of using the issue tracker.

Credits

About us

Offline Agency is a web design agency based in Padua, Italy. You'll find an overview of our projects on our website.

License

The MIT License (MIT). Please see License File for more information.

Releases

No releases published

Packages

No packages published

Languages