The Blog

Laravel

Laravel Artisan Database Command: The db:seed Command

John Koster
John Koster
December 7, 2016

The db:seed command is used to automatically add records to a database using a Seeder class. You can specify a specific seeder class, database connection, or force the seed to run in production. Examples of how to use the db:seed command are provided.

Laravel

Laravel Artisan Event Command: The event:generate Command

John Koster
John Koster
December 7, 2016

The event:generate command in Laravel allows you to automatically generate missing events and listeners based on your event service provider. It creates the necessary event and listener classes for you, which are stored in specific files. This command does not overwrite any previously generated classes and can be run multiple times. Alternatively, you can manually generate the event and listener classes using the make:event and make:listener commands, providing the event class and its associated listener class respectively.

Laravel

Laravel Artisan General Command: The clear-compiled Command

John Koster
John Koster
December 7, 2016

Learn how to use the clear-compiled command to clear the compiled classes and services cache in your Laravel application. The command, when run, deletes the compiled.php and services.php files from the bootstrap/cache/ directory. Execute the command php artisan clear-compiled to remove these files if they exist.

Laravel

Laravel Artisan General Command: The clear-resets Command

John Koster
John Koster
December 7, 2016

The auth:clear-resets command in Laravel is used to remove expired password reset tokens from the database. It has an optional name parameter to specify the password broker to clear tokens for. Two examples of using this command are shown. Running auth:clear-resets will delete expired tokens for the default password broker. This command is handy to keep the password_resets table clean.

Laravel

Laravel Artisan General Command: The config:cache Command

John Koster
John Koster
December 7, 2016

Learn how to improve the performance of your Laravel application by using the config:cache command. This command clears the existing configuration cache and generates a new cache file, resulting in faster loading of configuration values. Find out where the configuration cache file is located and how to run the command.

Laravel

Laravel Artisan General Command: The down Command

John Koster
John Koster
December 7, 2016

Learn how to put your Laravel application into maintenance mode using the down command. This command creates a file called down in the designated storage path, signaling maintenance mode. Easily execute this command with php artisan down.

Laravel

Laravel Artisan General Command: The env Command

John Koster
John Koster
December 7, 2016

Learn how to use the env command in Laravel to retrieve the name of the current framework environment. The environment name is determined by the value set in the .env file, particularly the APP_ENV entry. Execute php artisan env to see the current environment.

Laravel

Laravel Artisan General Command: The name Command

John Koster
John Koster
December 7, 2016

The app:name command in Laravel is used to update the application namespace. By running php artisan app:name, you can change the namespace for your Laravel application. This command accepts one argument, which is the new name of the application namespace. For example, if you run php artisan app:name LaravelArtisan, the namespace in the files such as Controller.php will be updated to LaravelArtisan\Http\Controllers.

Laravel

Laravel Artisan General Command: The optimize Command

John Koster
John Koster
December 7, 2016

Learn how to optimize your Laravel application's performance using the optimize command. This command offers two flags: --force, which writes the compiled class file even in debug mode, and --psr, which skips creating an optimized class map loader for better performance. The compiled files cache is written to bootstrap/cache/compiled.php. Examples of using the optimize command include generating a compiled class file with default options, excluding Composer autoload files, and running it on a development or debug machine. When using the --psr flag, the composer dump-autoload command is executed, while without it, composer dump-autoload -o is called.

Laravel

Laravel Artisan General Command: The serve Command

John Koster
John Koster
December 7, 2016

Learn how to use the serve command in Laravel to run your application using the PHP development server. This command is particularly useful for development and testing purposes. You can customize the server address and port by using the optional host and port options. Note that when using HHVM, it must be at least version 3.8.0 to use the internal development server. Check out the examples provided to get started quickly.

Latest posts

Where Things get Good: Moving on to Forte Development Phase 1

Wrapping up Forte Phase 0 with the lexer and parser now in private alpha, and kicking off Phase 1 wi...

Read more
Forte Update: Backtracking, Metadata, HTML Validation, and More

A Forte development update: the parser now supports backtracking, improvements to node metadata, ide...

Read more
Parsing HTML and Blade Attributes in Forte

Wrapping up attribute parsing in Forte's HTML parser, from simple HTML attributes to complex, edge-c...

Read more
Switch Statements and Parser Extensions in Forte

Exploring how Forte's parser extensions can be used to handle complex Blade directives like nested s...

Read more
Parsing Blade Comments in Forte

Digging into parsing Blade and HTML comments while building Forte's HTML parser for Laravel Blade.

Read more
Thoughts on HTML Elements and Blade Components in Forte

This week I’m tackling Forte's HTML parser - consolidating Blade, Flux, and Livewire components into...

Read more