php - How to implement version control inside a web app?

I'm building DMS (Document management system) using PHP framework Laravel.

One of the requirements is allowing users to version control files, close to what google docs does.

I've been searching for days without any clue, I don't want to re-impalement the wheel, there's a lot of really good VCS already including git which I'm thinking of utilizing it using php to implement the versioning features.

I just don't know how to start or even my way of thinking is valid!

Answer

Solution:

What you need is real-time system (achieved via socket programming) so that everyone is updated about the contents in realtime; also who is doing what: Like if there are two users A and B and they have opened the same file then A should know what the B is doing and vice versa; you would use client events for that. Have a look here: https://laracasts.com/series/get-real-with-laravel-echo

Or

Look into Web RTC: https://webrtc.org/

GIT is a different thing given your requirements what I understood.

Source