vendor/illuminate/database/Seeder.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace Illuminate\Database;
use Illuminate\Support\Arr;
use InvalidArgumentException;
use Illuminate\Console\Command;
use Illuminate\Container\Container;
abstract class Seeder
{
/**
* The container instance.
*
* @var \Illuminate\Container\Container
*/
protected $container;
/**
* The console command instance.
*
* @var \Illuminate\Console\Command
*/
protected $command;
/**
* Seed the given connection from the given path.
*
* @param array|string $class
* @param bool $silent
* @return $this
*/
public function call($class, $silent = false)
{
$classes = Arr::wrap($class);
foreach ($classes as $class) {
$seeder = $this->resolve($class);
if ($silent === false && isset($this->command)) {
$this->command->getOutput()->writeln('<info>Seeding:</info> '.get_class($seeder));
}
$seeder->__invoke();
}
return $this;
}
/**
* Silently seed the given connection from the given path.
*
* @param array|string $class
* @return void
*/
public function callSilent($class)
{
$this->call($class, true);
}
后面还有 67 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
