Slide 1

Slide 1 text

Laravel Zero Laravel Zero - Laravel Austin 1

Slide 2

Slide 2 text

Micro-framework for command-line applications Provides an elegant starting point for your console application Laravel Zero - Laravel Austin 2

Slide 3

Slide 3 text

Installation Laravel Zero - Laravel Austin 3

Slide 4

Slide 4 text

Installation — composer global require "laravel-zero/installer" Laravel Zero - Laravel Austin 3

Slide 5

Slide 5 text

Installation — composer global require "laravel-zero/installer" — composer create-project --prefer-dist laravel-zero/ laravel-zero movie-cli Laravel Zero - Laravel Austin 3

Slide 6

Slide 6 text

Commands By default Laravel Zero comes with a InspiringCommand as an example php make:command Laravel Zero - Laravel Austin 4

Slide 7

Slide 7 text

Desktop Notifications $this->notify("Hello Web Artisan", "Love beautiful..", "icon.png"); Laravel Zero - Laravel Austin 5

Slide 8

Slide 8 text

Tasks $this->task("Installing Laravel", function () { return true; }); $this->task("Doing something else", function () { return false; }); Laravel Zero - Laravel Austin 6

Slide 9

Slide 9 text

Interactive Menus $option = $this->menu('Pizza menu', [ 'Freshly baked muffins', 'Freshly baked croissants', 'Turnovers, crumb cake, cinnamon buns, scones', ])->open(); $this->info("You have chosen the option number #$option"); $this->menu($title, $options) ->setForegroundColour('green') ->setBackgroundColour('black') ->setWidth(200) ->setPadding(10) ->setMargin(5) ->setExitButtonText("Abort") // remove exit button with // ->disableDefaultItems() ->setUnselectedMarker('❅') ->setSelectedMarker('✏') ->setTitleSeparator('*-') ->addLineBreak('<3', 2) ->addStaticItem('AREA 2') ->open(); Laravel Zero - Laravel Austin 7

Slide 10

Slide 10 text

Service Providers Laravel Zero recommends using Service Providers for defining concrete implementations Laravel Zero - Laravel Austin 8

Slide 11

Slide 11 text

Config Laravel Zero utilizes the same configuration system as Laravel. 'production' => true, Laravel Zero - Laravel Austin 9

Slide 12

Slide 12 text

Database Laravel Zero allows you to install a Laravel's Eloquent component php app:install database Laravel Zero - Laravel Austin 10

Slide 13

Slide 13 text

Logging php app:install log Laravel Zero - Laravel Austin 11

Slide 14

Slide 14 text

Filesystem Laravel Zero ships with the Filesystem component by default use Illuminate\Support\Facades\Storage; Storage::put("reminders.txt", "Task 1"); Laravel Zero - Laravel Austin 12

Slide 15

Slide 15 text

Scheduler Laravel Zero ships with the Task Scheduling system of Laravel * * * * * php /path-to-your-project/your-app-name schedule:run >> /dev/null 2>&1 public function schedule(Schedule $schedule): void { $schedule->command(static::class)->everyMinute(); } Laravel Zero - Laravel Austin 13

Slide 16

Slide 16 text

Environment Configuration Laravel Zero also supports DotEnv based environment configuration php app:install dotenv Laravel Zero - Laravel Austin 14

Slide 17

Slide 17 text

Collision A detailed and intuitive error handler framework for console applications Laravel Zero - Laravel Austin 15

Slide 18

Slide 18 text

Tinker Laravel Zero is a powerful REPL for Laravel Laravel Zero - Laravel Austin 16

Slide 19

Slide 19 text

Tests use Tests\TestCase; use Illuminate\Support\Facades\Artisan; class InspiringCommandTest extends TestCase { /** * A basic test example. */ public function testInspiringCommand(): void { Artisan::call('inspiring'); $this->assertContains('Leonardo da Vinci', Artisan::output()); } } Laravel Zero - Laravel Austin 17

Slide 20

Slide 20 text

DEMO Laravel Zero - Laravel Austin 18