Command line in CodeIgniter 4, Spark

CodeIgniter has a very easy to use command line (CLI) known as spark; spark is nothing more than a file that is located in the root of our project with the name "spark" and allows executing a series of pre-established commands; Of course, we can extend the commands offered by the framework itself by programming our own commands; but this is another topic; In short, we can divide the commands that we can use into three groups:

Commands to generate files:

  1. Create migrations, we will talk about this in another chapter, but they are nothing more than files that store the structure of a table that the framework will map to the database.
  2. Generate seeds or seeds for test data.

Commands to handle processes:

  1. Set up a development server, in case you don't want to use Apache or other servers supported by the framework.
  2. Run or return migrations.
  3. Clear cache.
  4. Manage the database.
  5. Run the migrations and seeds.

Commands to get project information:

  1. Command list.
  2. List of project routes.

Among other commands you can see running at the project level:

$ php spark

Commands more employees

So that you have a list of the commands; I recommend that you copy and read it a few times a day and familiarize yourself with these commands that are the most used when developing in CodeIgniter:

  1. php spark serve: To build a development server.
  2. php spark make:migration: To generate a migration file.
  3. php spark migrate: To generate a migration and related as the rollback to return the migrations.
  4. php spark routes: To view the routes of the application.

Do not worry if you do not understand the purpose of these functions, later we will see in detail the operation of each of these elements.

- Andrés Cruz

En español
Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.