xmhafiz / laravel-fcm-realtime

"Near Realtime Webapp" using Laravel + Firebase cloud messaging js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel + FCM Example

This project purposely created for Laratalk #5 on Real-time Webapp using JavaScript Firebase Cloud Messaging API. Refer the Preseentation here

It is basically a simple report monitoring with maps. So, user will submit the report and the page will autmatically updated.

Requirement

  • PHP 5.6.4+ for Laravel 5.4
  • WebPush API only working on Chrome: 50+, Firefox: 44+, Opera Mobile: 37+ (supports Service worker)

Setup

  • Run composer install
  • Copy env.example to .env and add your DB details
  • Migrate database php artisan migrate
  • Go to Firebase Console and add new project
  • Click on Setting icon > Project Setting > Cloud Message and copy the Legacy server key to be added in .env as FIREBASE_KEY. Also update messagingSenderId in public/firebase-messaging-sw.js
  • Now you are ready to Go!. Take a look at route / for simulating Realtime Dashboard Report and /report/submit to add new report.

Todo

  • Js code refactor
  • Implement tests

License

This project is licensed under the MIT license.

About

"Near Realtime Webapp" using Laravel + Firebase cloud messaging js


Languages

Language:PHP 81.6%Language:HTML 17.2%Language:Vue 0.6%Language:ApacheConf 0.6%