A simple, proof-of-concept Laravel blog application powered by a MongoDB ORM.

Overview

Mongoblog

Laravel feat. MongoDB

A simple, proof-of-concept Laravel blog application powered by a MongoDB ORM.

Separated API and front-end

This is a RESTful application, whose API is entirely decoupled from its front-end (neat, eh?), meaning it is fully testable from a REST client like Postman or from PHPStorm's built-in client.

To test the API endpoints on Postman:

  1. Serve the application with php artisan serve or Valet.
  2. Seed the database with data fixtures by running php artisan migrate --seed.
  3. Get an overview of the api/v1 routes by running php artisan route:list.
  4. Download the Postman collection here and import the file into your Postman client.
  5. Start testing (and remember to change environment variables as needed).

System requirements

  • PHP v7.x
  • MongoDB v3.4
  • nginx 1.10 or PHP's built-in web server

Gotchas

I'm having issues installing the jenssegers/mongodb package.

Run php -m | grep mongodb to confirm that the MongoDB PHP extension is installed.

If the above does not work, run composer install --ignore-platform-reqs.


I'm getting Class 'MongoDB\Driver\Manager' not found when I run the application

Restart your web server. It probably has not loaded the php-mongodb extension yet.

Can I revert back to MySQL/SQLite without issue?

Unfortunately, as this library is not officially supported by Laravel, it comes with integration issues here and there, a few which are:

  • The inability to drop tables using dropIfExists.
  • Missing polyfills on its drop-in Eloquent replacement.
  • The inability to use a table's id column on the default query builder; you'll have to use _id -- the convention with which MongoDB stores primary keys. This has given me problems with validation rules:
    'post_id' => 'in:posts,id'
    
    ... does not work, so I have to replace it with:
     'post_id' => 'in:posts,_id'
    

I initially wanted to test polymorphic relationships with the Category and Comment models, but just went with a many-to-many due to the lack of documentation.


Why aren't you using Route::dispatch() or app()->handle() to consume internal API endpoints?

Taylor Otwell advises against using sub-requests to make internal API calls, as they mess the current route. I went with this kitetail/zttp package by Adam Wathan that leverages Guzzle and I wrapped it within a trait.

Features & suggestions

View the Projects page for a roadmap of things to come.

If you come across a bug, feel free to open a new issue. For a bug specific to the MongoDB ORM, submit a ticket via their GitHub page.

To-do

  • Authentication
  • Integration tests
  • Front-end / templates

For a comprehensive list of to-dos for the core functionality of the application, visit the Core features project page.

You might also like...
This is a simple blog system, you can sign up and create post.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Self hosted project management and collaboration tool powered by TALL stack
Self hosted project management and collaboration tool powered by TALL stack

Sponsored By: Self hosted project management and collaboration tool inspired by basecamp. Notice: Project under some major change, do not use until st

Shoutit is a PHP powered shoutbox which uses mySQL to store shouts
Shoutit is a PHP powered shoutbox which uses mySQL to store shouts

This is a very basic PHP/MySQL application. built to prove my usuage of basic php + MySQL. It is very easy to use, has error checking, and very fast. Users can post shouts along with their names & comment.

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony

Grav Grav is a Fast, Simple, and Flexible, file-based Web-platform. There is Zero installation required. Just extract the ZIP archive, and you are alr

A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4
A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4

Larablog A powerful open source Laravel Blog with WYSWYG and CRUD (Create Read Update Delete) built on Laravel 5.8 and Bootstrap 4 Table of contents F

This is a blog. A project was written in Laravel 8

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

FULL STACK LARAVEL BLOG SITE

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Blog dengan framework laravel 8 sebagai backend dan tailwind sebagai frontend

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Latihan membuat Blog menggunakan LARAVEL

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Owner
Jayps
www.creedthoughts.gov.www\creedthoughts
Jayps
Laravel-Blog is a blog application written in Laravel 4.2.

创造不息,交付不止 Introduction Laravel-Blog is a blog project written in Laravel 4.2. Screenshots Article List Page Article composing page Single post page Ad

Summer 192 Dec 15, 2022
A powerful and responsive blog system powered by laravel 5.5.

Powerful and responsive blog system powered by laravel 5.5. Click https://lufficc.com/blog to view live demo. Xblog 中文 README | Docs This blog is for

Congcong Li 924 Nov 18, 2022
UserFrosting is a secure, modern user management system written in PHP and built on top of the Slim Microframework, Twig templating engine, and Eloquent ORM.

UserFrosting 4.6 Branch Version Build Coverage Style master hotfix develop https://www.userfrosting.com If you simply want to show that you like this

UserFrosting 1.6k Jan 1, 2023
Bludit - a web application to build your own website or blog in seconds

Bludit is a web application to build your own website or blog in seconds, it's completely free and open source. Bludit uses files in JSON format to store the content, you don't need to install or configure a database. You only need a web server with PHP support.

BLUDIT 1.1k Jan 1, 2023
A simple blog project I built when learning Laravel 8

Harmonify Blog Disclaimer: All users data previewed on the image are fake data generated with FakerPHP. Introduction Harmonify Blog is a simple blog p

Wendy Surya Wijaya 3 Dec 9, 2021
A simple and useful blog coded with laravel & php.

Blog with Setup Directions npm install composer install Set database infos in the .env php artisan migrate:fresh --seed php artisan serve npm run hot

Mustafa Tofur 1 Oct 11, 2022
A simple blog package for Laravel 4

Laravel Blog A Laravel 4 package to add a simple blog to a site Features Paginated index view with configurable results per page Year/Month archive fi

Five by Five 74 Apr 12, 2020
Project of Simple Blog using: HTML, CSS, PHP, MYSQL, and BOOTSTRAP

Project-Stormwind Project of Simple Blog using: HTML, CSS, PHP, MYSQL, and BOOTSTRAP Functions : A personal blog about Blizzard and their work Main Th

Jan Andrzejewski 2 Aug 24, 2022
A very simple Blog with Admin Panel built using Laravel5.7 && VueJs2.5 - Quasar0.17

Q-Blog - A very simple Blog with Admin Panel built using [Laravel5.7, VueJs2.5, Quasar0.17]. - This is kind of implementation on different concepts in

Abdelaziz Sliem 132 Dec 23, 2022
A simple blog project based on a custom-created MVC framework using PHP & MySQL

A simple blog project based on a custom-created MVC framework using PHP & MySQL. That follows the Facade design pattern.

Samiul Arafah Dhrubo 2 May 28, 2022