Presenting: LaravelMicro.js

A Laravel style frontend framework that works with your UI framework of choice.

Daniel Alvidrez
2 min readMar 3, 2019

LaravelMicro.js is an IOC Container, Service Locator Pattern and Middleware Pipeline for your the frontend of your Laravel application. It provides true dependency injection and a familiar design that encourages you to use object oriented principles.

Features

Compatible with Reactive Frameworks like Vue.js and React.

  • Config
  • Container
  • Binding
  • Dependency Injection
  • Error Handling
  • Kernel
  • Lazy Loading
  • Middleware
  • Pipelines
  • Paginated CRUD Collections (Reactive Ready)
  • Router Integration
  • Service Providers
  • Sharing
  • Traits

Vue Components

I’ve included some basic bootstrap compatible Vue components that are bundled with the Frontend Preset Package. These components will help visualize the state of your application as well as the log output when debugging mode is active.

How to Get Started

  1. View the Wiki for Examples and Documentation
  2. View the Demo App for a Live Preview

Laravel Scaffolding Preset:

php artisan make:micro

https://github.com/bayareawebpro/laravel-micro-preset

NPM Installation

npm i laravel-micro.js

About this Project

I started with Laravel 4.x, my first real framework as I moved away from Wordpress & Expression Engine. Over the years it’s really taught me to be a better programmer and truly appreciate the power that the core implementation offers.

As javascript has matured I’ve grown to love my UI frameworks like Vue.js but the current functional paradigm in javascript left me frustrated and I longed for the structure and object oriented approach that I’ve learned from studying and working with Taylor’s code on a nearly daily basis.

This project was first a quest to see what could be done, and quickly turned into building as close an implementation that I could from my knowledge of the Laravel public API. While things do not work the exact same way Laravel does internally, I did my best to build things in a way that would satisfy my cravings for structure and methodology while achieving my goals for some kind of IOC and service locator.

While not every frontend application needs this level of power, it’s given me hopes to keep pushing forward in my quest to build the best applications I can, from the back to the front.

Made with ❤️ in California.

--

--

Daniel Alvidrez

Full Stack Developer — Community Moderator @ Laravel PHP Framework Facebook Group