Most Recent Post


Laravel Model Generator

Posted May 18, 2016 10:49 PM (1 week ago)

Laravel Model Generator

I was looking for a model generator that would generate my models based on pre-existing database tables. I did find a couple however, they just never did exactly what I wanted.

Thus I created my own Model Generator and released it under the Laracademy github.

What is it?

Well this generator as I said above will take any table in your database and it will generate a model for you. Except this isn't any kids generator where they just give you a boiler plate and you have to fill in the rest. This generator will try it's best to figure out which columns are fillable, which columns are dates and which columns need to be casted as booleans, etc.

So what does that mean?

That means that you don't need to fill out most of your model any more! Instead of having the painful task of adding in all those fillable fields they will be generated from the database itself.

How do I get it?

The easiest way to get it is via composer

composer require "laracademy/model-generator"

You can read more about the information but visiting the Github Repository, or the Packagist listing.

Before I try this, do you have an example.

Yes we sure do, you can watch the quick video below.


Thank you, and happy coding!

Share:
Tags:
Laravel 5.1 | Laravel 5.2 | PHP

Laravel Session Woes

Posted April 27, 2016 6:08 PM (1 month ago)


Laravel Session Woes

I have seen in the past little while that there have been a number of problems with Laravel's Sessions not being saved across views. A lot of the times this is because of a change that was made between Laravel 5.2.26 and 5.2.27

Introducing double Web Middleware

Double web middle-what? Laravel recently changed the way the default middleware works. The web middleware is in charge of items like Session Data, CSRF protection, etc.

In Laravel 5.2.26 they moved the middleware into the routes so that you could easily put routes outside the middleware (such as api routes). However there must have been some issues as they moved it back into a Service provider in 5.2.27

Lucky the fix is an easy one and there is a video for it and it is (free): 

https://laracademy.co/videos/laravel-5/session-woes-in-laravel
Share:
Tags:
Laravel 5.2 | PHP

There is tons more to read