Fixing invalid namespace for TelegramSession model

This commit is contained in:
Setiawan Hu 2020-08-13 23:11:53 +07:00
parent 5b404503fc
commit 0b2840f819

View File

@ -110,15 +110,10 @@ class MultiSessionCommand extends Command
public function compileModelStub(string $user) public function compileModelStub(string $user)
{ {
$stub = file_get_contents(__DIR__ . '/stubs/telegram_session.stub'); $stub = file_get_contents(__DIR__ . '/stubs/telegram_session.stub');
$namespace = str_replace(
"/" . class_basename($user),
"",
$user
);
return str_replace( return str_replace(
['{{user}}', '{{package}}'], ['{{user}}', '{{package}}'],
[Str::snake(class_basename($user)), $namespace], [Str::snake(class_basename($user)), 'App'],
$stub $stub
); );
} }