Skip to content

Commit

Permalink
deleted some file
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirHkrg committed Jul 12, 2023
1 parent c30361a commit f6f6612
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ LOG_FOLDER=
MYSQL_POWER=on
MYSQL_DRIVER=mysql
MYSQL_HOST=localhost
MYSQL_DATABASE=MyDatabase
MYSQL_DATABASE=laragram
MYSQL_USERNAME=root
MYSQL_PASSWORD=
MYSQL_CHARSET=utf8
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ LaraGram, an advanced framework for Telegram Bot development
- Support Bot Api Server
- Laravel Eloquent
- Model
- Migration
- Database
- MySql
- Redis
Expand Down Expand Up @@ -179,12 +178,10 @@ php bot make:resource my-resource
php bot remove:resource my-resource
```

###### model and migration
###### model

```
php bot make:model User
php bot make:migration create_users_table
```

###### Server
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"symfony/process": "^6.3",
"bramus/ansi-php": "^3.1",
"ext-curl": "*",
"ext-redis": "*"
"ext-redis": "*",
"illuminate/database": "^10.15",
"illuminate/events": "^10.15",
"doctrine/dbal": "^3.6"
}
}
}
5 changes: 0 additions & 5 deletions core/cli/action/calling.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
$database = new DatabaseMaker();
$database->createModel();
});

$kernel->call('make:migration', function () {
$database = new DatabaseMaker();
$database->createMigration();
});
//-----------------------------------------------------------------
$kernel->call('make:resource', function () {
$resource = new ResourceMaker();
Expand Down
33 changes: 1 addition & 32 deletions core/cli/action/databaseMaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@ public function createModel(): void
return;
}

if (!isset($this->cmd[3]) || @$this->cmd[3] == '--mysql') {
$this->createMysqlModel();
}
}

public function createMigration(): void
{
if (!isset($this->cmd[2])) {
Logger::status('Warning', 'Enter the Migration name!', 'warning');
return;
}

if (!isset($this->cmd[3]) || @$this->cmd[3] == '--mysql') {
$this->createMysqlMigrations();
}
}

private function createMysqlModel(): void
{
$migrationPage = str_replace('&&&', $this->cmd[2], file_get_contents('core/cli/layout/mysqlModel.txt'));
$fileName = 'app/model/' . $this->cmd[2] . '.php';
if (file_exists($fileName)) {
Expand All @@ -49,16 +30,4 @@ private function createMysqlModel(): void
Logger::success('Mysql Model Created Successfully!');
}
}

private function createMysqlMigrations(): void
{
$migrationPage = str_replace('&&&', $this->cmd[2], file_get_contents('core/cli/layout/mysqlMigrations.txt'));
$fileName = 'database/mysql/migrations/' . $this->cmd[2] . '.php';
if (file_exists($fileName)) {
Logger::warning('Migration is already exist!');
} else {
file_put_contents($fileName, $migrationPage);
Logger::success('Mysql Migration Created Successfully!');
}
}
}
}
29 changes: 0 additions & 29 deletions database/mysql/migrations/create_users_table.php

This file was deleted.

0 comments on commit f6f6612

Please sign in to comment.