The command php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="migrations" just gives us:
Unable to locate publishable resources
We have all the models in a "Models" folder. Can it be the case here?
Hey,
could it be that you already have a class named CreateActivityLogTable? The models aren't important for the publish step.
Ohh, my. So sorry! Thanks!
same issue
class ActivitylogServiceProvider extends PackageServiceProvider
{
public function configurePackage(Package $package): void
{
$package
->name('laravel-activitylog')
->hasConfigFile('activitylog')
->hasMigrations([
'CreateActivityLogTable',
'AddEventColumnToActivityLogTable',
'AddBatchUuidColumnToActivityLogTable',
])
->hasCommand(CleanActivitylogCommand::class);
}
public function registeringPackage()
{
$this->app->bind(ActivityLogger::class);
$this->app->singleton(LogBatch::class);
$this->app->singleton(CauserResolver::class);
$this->app->singleton(ActivityLogStatus::class);
}
public static function determineActivityModel(): string
{
$activityModel = config('activitylog.activity_model') ?? ActivityModel::class;
if (! is_a($activityModel, Activity::class, true)
|| ! is_a($activityModel, Model::class, true)) {
throw InvalidConfiguration::modelIsNotValid($activityModel);
}
return $activityModel;
}
public static function getActivityModelInstance(): ActivityContract
{
$activityModelClassName = self::determineActivityModel();
return new $activityModelClassName();
}
}
Most helpful comment
Ohh, my. So sorry! Thanks!