PHP code example of webrium / console

1. Go to this page and download the library: Download webrium/console library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webrium / console example snippets




use Foxdb\DB;
use Foxdb\Seeders\Seeder;

class UsersSeeder extends Seeder
{
    public function run(): void
    {
        // DB::table('users')->insert([
        //     'name'  => 'Admin',
        //     'email' => '[email protected]',
        // ]);

        // To call other seeders:
        // $this->call(RolesSeeder::class);
    }
}
bash
php webrium init
bash
php webrium make:model <Name> [--table=<table>] [--no-plural] [--force]
bash
php webrium make:controller <Name> [--namespace=<Namespace>] [--force]
bash
php webrium make:controller User
php webrium make:controller Admin --namespace="App\Controllers\Admin"
bash
php webrium make:route <Name> [--force]
bash
php webrium make:route Api
php webrium make:route Web --force
bash
php webrium make:migration <name> [--table=<table>] [--force]
bash
php webrium migrate [<action>] [--step=<n>] [--connection=<name>] [--force]
bash
php webrium make:seeder <Name> [--force]
bash
php webrium make:seeder UsersSeeder
php webrium make:seeder roles_seeder        # generated as RolesSeeder.php
php webrium make:seeder UsersSeeder --force
bash
php webrium db:seed [<class>] [--connection=<name>] [--no-transaction] [--force]
bash
php webrium call <Class@Method> [--params=<JSON>] [--model] [--namespace=<Namespace>]
bash
php webrium call UserController@index
php webrium call UserController@find --params='[42]'
php webrium call User@active --model
php webrium call Report@generate --params='["2024-01", true]' --namespace="App\Services"
bash
php webrium db <action> [<name>] [--use=<database>] [--force]
bash
php webrium db list
php webrium db tables --use=my_database
php webrium db create my_database
php webrium db drop my_database
php webrium db drop my_database --force
bash
php webrium table <action> <table_name> [--use=<database>] [--force]
bash
php webrium table info users
php webrium table columns orders --use=shop_db
php webrium table drop sessions
php webrium table drop sessions --force
php webrium table rename old_table new_table
php webrium table copy products products_backup
php webrium table exists users
php webrium table count orders
php webrium table run sql/setup_tables.sql --use=shop_db
bash
php webrium log <action> [<name>]
bash
php webrium log list
php webrium log latest
php webrium log file 2024-01-15.log
php webrium log clear
bash
php webrium plugin:new admin-panel
php webrium plugin:export admin-panel 1.2.0 --dry-run
php webrium plugin:export admin-panel 1.2.0