Namespace Models

The Namespace Models scans your Laravel application for Models and moves them under the app/Models folder.

Requirements

A Laravel application running Laravel 5.1 or higher.

Why Namespace Models?

The app/Models folder existed in earlier versions of Laravel. Laravel 5 moved models to the top-level of the app folder by default. However, analytics show when the number of models grows into the double digits it is still common practice to organize models under app/Models.

Automated Changes

  • Moving Models from top-level under app/Models folder.
  • Updating model references within application code.
  • Adopting the PSR-2 coding style to match the coding style in Laravel.
  • Modernizing PHP syntax, such as the short array syntax.
  • Converting string based class references to ::class references.

Manual Changes

While the Namespace Models Shift automates changes within your application code, there may be additional model references outside your code - such as database relationships and environmental configuration.

Still have questions? Message @laravelshift on Twitter or email shift@laravelshift.com.