• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

artisan

Laravel 5.1 with Forge

June 14, 2015

Laravel 5.1 was released in June 9, 2015. So, I updated my development environment with version 5.1 and updated it to GitHub. From there, I spun a server via Forge at Digital Ocean. Then, I deployed my development repository via GitHub.

However, I faced two issues:

  1. I was getting an error saying that there is not enough memory. The simple fix is to do a composer update in your dev environment and then upload your changes to GitHub. If you have automatic deploy turned on, then the changes will be updated on the server.
  2. The other error was a missing app key. You can fix this by simply running artisan key:generate on the server. You must have a .env file on the Laravel directory. I believe it’s under /home/forge/default. You can create one or copy the .env.example.

Hopefully, I save you some time with troubleshooting if you run into these issues.

Filed Under: PHP Tagged With: app key, artisan, forge, laravel

Generate a Controller in Laravel

June 3, 2015

Laravel comes with several generators by way of Artisan CLI or Command Line Interface. To generate a controller, you simply run the following command from the Terminal. This is assuming you’re in the Laravel project folder.

// generate a standard Controller
$ php artisan make:controller HomeController
 
// generate a plain Controller with no methods
$ php artisan make:controller HomeController --plain

// generate a standard Controller $ php artisan make:controller HomeController // generate a plain Controller with no methods $ php artisan make:controller HomeController --plain

The first example is the standard way of generating a controller with resourceful routing in mind.

The second example is plain way of generating a controller. It does not contain any method.

Filed Under: PHP Tagged With: artisan, cli, controller, generate, laravel

  • Home
  • About
  • Archives

Copyright © 2023