Composer users spl_autoload_register() to load classes etc.
using NunoMaduro\Collision you get beautiful output of error on Console.
Just by using Application class from Symfony/Console we get this beautiful output on console.
Let's make a command. "inspire" command.
use Symfony command for now.
InspireCommand not showing. We have to manually register it.
We want to be able to pass the command name inside the command class as property. To handle with this we'll need to create an abstract base Command class.
And pass the name in the constructor. Really cool.
And InspireCommand uses this Command instead of Symfony Command.
We can also add command description
Making $this->info() available on Command as Laravel does.
Making the `make` command and register it.
Accept the argument. $_SERVER['argv']
argument we want is on the second position, TinkerCommand
Command.stub
MaekCommand.php
Create the TinkerCommand with Tinker functionality.
We can create Tinker with just one line? š¤Æ
readline() method in PHP ( surely didn't know about this )
eval() the code , don't try this at home.
while(true) to keep the session alive.
Tinker in one line š¤Æ
php artisan down
App is in maintenance mode.
Just create the down file and then Laravel checks inside middleware, if that file exists, echo "App is under maintenance" and exit(1);