<code> /**
* Resolve a migration instance from a file.
*
* @param string $file
* @return object
*/
public function resolve($file)
{
$class = $this->getMigrationClass($file);
return new $class;
}
/**
* Resolve a migration instance from a migration path.
*
* @param string $path
* @return object
*/
protected function resolvePath(string $path)
{
$class = $this->getMigrationClass($this->getMigrationName($path));
if (class_exists($class) && realpath($path) == (new ReflectionClass($class))->getFileName()) {
return new $class;
}
$migration = static::$requiredPathCache[$path] ??= $this->files->getRequire($path);
if (is_object($migration)) {
return method_exists($migration, '__construct')
? $this->files->getRequire($path)
: clone $migration;
}
return new $class;
}
</code>
<code> /**
* Resolve a migration instance from a file.
*
* @param string $file
* @return object
*/
public function resolve($file)
{
$class = $this->getMigrationClass($file);
return new $class;
}
/**
* Resolve a migration instance from a migration path.
*
* @param string $path
* @return object
*/
protected function resolvePath(string $path)
{
$class = $this->getMigrationClass($this->getMigrationName($path));
if (class_exists($class) && realpath($path) == (new ReflectionClass($class))->getFileName()) {
return new $class;
}
$migration = static::$requiredPathCache[$path] ??= $this->files->getRequire($path);
if (is_object($migration)) {
return method_exists($migration, '__construct')
? $this->files->getRequire($path)
: clone $migration;
}
return new $class;
}
</code>
/**
* Resolve a migration instance from a file.
*
* @param string $file
* @return object
*/
public function resolve($file)
{
$class = $this->getMigrationClass($file);
return new $class;
}
/**
* Resolve a migration instance from a migration path.
*
* @param string $path
* @return object
*/
protected function resolvePath(string $path)
{
$class = $this->getMigrationClass($this->getMigrationName($path));
if (class_exists($class) && realpath($path) == (new ReflectionClass($class))->getFileName()) {
return new $class;
}
$migration = static::$requiredPathCache[$path] ??= $this->files->getRequire($path);
if (is_object($migration)) {
return method_exists($migration, '__construct')
? $this->files->getRequire($path)
: clone $migration;
}
return new $class;
}
I tried changing some things but it didn’t work. Laravel 9 is the main framework that is being used here on my company. “Class “CreateUsersTable” not found”
Here’s the new set of files:
0001_01_01_000001_create_users_table
0001_01_01_000002_create_password_resets_table
0001_01_01_000003_create_failed_jobs_table
0001_01_01_000004_create_personal_access_tokens_table
New contributor
Daniell is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.