Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

Add strict_types to automation files and AutomationNodeState factory

Paulo Castellano6d3a375add4c
diff --git a/app/Models/AutomationNodeRun.php b/app/Models/AutomationNodeRun.php
index 83fd0b2a2..efdda37a2 100644
--- a/app/Models/AutomationNodeRun.php
+++ b/app/Models/AutomationNodeRun.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace App\Models;
use App\Enums\Automation\Node\Type as NodeType;
diff --git a/app/Models/AutomationNodeState.php b/app/Models/AutomationNodeState.php
index 68bc56487..619a026e8 100644
--- a/app/Models/AutomationNodeState.php
+++ b/app/Models/AutomationNodeState.php
@@ -5,11 +5,13 @@ declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class AutomationNodeState extends Model
{
+ use HasFactory;
use HasUuids;
protected $guarded = [];
diff --git a/app/Models/AutomationRun.php b/app/Models/AutomationRun.php
index 0fe66800c..fb57401b3 100644
--- a/app/Models/AutomationRun.php
+++ b/app/Models/AutomationRun.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace App\Models;
use App\Enums\Automation\Run\Status;
diff --git a/app/Models/AutomationTriggerItem.php b/app/Models/AutomationTriggerItem.php
index 69953c750..0c9abfa53 100644
--- a/app/Models/AutomationTriggerItem.php
+++ b/app/Models/AutomationTriggerItem.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace App\Models;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
diff --git a/bootstrap/app.php b/bootstrap/app.php
index 890904a1f..996308def 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Http\Middleware\Api\LoadWorkspaceFromToken;
use App\Http\Middleware\App\EnsureRegistrationEnabled;
use App\Http\Middleware\App\HandleInertiaRequests;
diff --git a/database/factories/AutomationFactory.php b/database/factories/AutomationFactory.php
index 18d5b6292..1dcaed65b 100644
--- a/database/factories/AutomationFactory.php
+++ b/database/factories/AutomationFactory.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Database\Factories;
use App\Enums\Automation\Status;
diff --git a/database/factories/AutomationNodeRunFactory.php b/database/factories/AutomationNodeRunFactory.php
index 116af95dd..e68c6313a 100644
--- a/database/factories/AutomationNodeRunFactory.php
+++ b/database/factories/AutomationNodeRunFactory.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Database\Factories;
use App\Enums\Automation\Node\Type as NodeType;
diff --git a/database/factories/AutomationNodeStateFactory.php b/database/factories/AutomationNodeStateFactory.php
new file mode 100644
index 000000000..92ba1fc5c
--- /dev/null
+++ b/database/factories/AutomationNodeStateFactory.php
@@ -0,0 +1,23 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Database\Factories;
+
+use App\Models\Automation;
+use App\Models\AutomationNodeState;
+use Illuminate\Database\Eloquent\Factories\Factory;
+
+class AutomationNodeStateFactory extends Factory
+{
+ protected $model = AutomationNodeState::class;
+
+ public function definition(): array
+ {
+ return [
+ 'automation_id' => Automation::factory(),
+ 'node_id' => 'node_'.fake()->randomNumber(6),
+ 'data' => [],
+ ];
+ }
+}
diff --git a/database/factories/AutomationRunFactory.php b/database/factories/AutomationRunFactory.php
index cf29d6fb9..f6bfbec4a 100644
--- a/database/factories/AutomationRunFactory.php
+++ b/database/factories/AutomationRunFactory.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Database\Factories;
use App\Enums\Automation\Run\Status;
diff --git a/database/factories/AutomationTriggerItemFactory.php b/database/factories/AutomationTriggerItemFactory.php
index 93a5a2f33..ca370207e 100644
--- a/database/factories/AutomationTriggerItemFactory.php
+++ b/database/factories/AutomationTriggerItemFactory.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Database\Factories;
use App\Models\Automation;
diff --git a/database/migrations/2026_05_22_211640_create_automations_table.php b/database/migrations/2026_05_22_211640_create_automations_table.php
index 173b92699..23f5d423b 100644
--- a/database/migrations/2026_05_22_211640_create_automations_table.php
+++ b/database/migrations/2026_05_22_211640_create_automations_table.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
diff --git a/database/migrations/2026_05_22_211641_create_automation_trigger_items_table.php b/database/migrations/2026_05_22_211641_create_automation_trigger_items_table.php
index 6a573f0a0..64016a4b9 100644
--- a/database/migrations/2026_05_22_211641_create_automation_trigger_items_table.php
+++ b/database/migrations/2026_05_22_211641_create_automation_trigger_items_table.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
diff --git a/database/migrations/2026_05_22_211642_create_automation_runs_table.php b/database/migrations/2026_05_22_211642_create_automation_runs_table.php
index ba7e45e23..70c65da7f 100644
--- a/database/migrations/2026_05_22_211642_create_automation_runs_table.php
+++ b/database/migrations/2026_05_22_211642_create_automation_runs_table.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
diff --git a/database/migrations/2026_05_22_211643_create_automation_node_runs_table.php b/database/migrations/2026_05_22_211643_create_automation_node_runs_table.php
index ad8e1bf25..e285911ef 100644
--- a/database/migrations/2026_05_22_211643_create_automation_node_runs_table.php
+++ b/database/migrations/2026_05_22_211643_create_automation_node_runs_table.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
diff --git a/database/migrations/2026_05_23_164734_create_automation_node_states_table.php b/database/migrations/2026_05_23_164734_create_automation_node_states_table.php
index 76730bc60..a830cb421 100644
--- a/database/migrations/2026_05_23_164734_create_automation_node_states_table.php
+++ b/database/migrations/2026_05_23_164734_create_automation_node_states_table.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
diff --git a/lang/en/automations.php b/lang/en/automations.php
index 24d1123c3..91a91d9d6 100644
--- a/lang/en/automations.php
+++ b/lang/en/automations.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
return [
'title' => 'Automations',
'default_name' => 'New automation',
diff --git a/lang/en/sidebar.php b/lang/en/sidebar.php
index 28138b211..2892a5f62 100644
--- a/lang/en/sidebar.php
+++ b/lang/en/sidebar.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
return [
'workspaces' => 'Workspaces',
'select_workspace' => 'Select workspace',
diff --git a/lang/es/automations.php b/lang/es/automations.php
index 65c3a8574..754b0f976 100644
--- a/lang/es/automations.php
+++ b/lang/es/automations.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
return [
'title' => 'Automatizaciones',
'default_name' => 'Nueva automatización',
diff --git a/lang/es/sidebar.php b/lang/es/sidebar.php
index e0705d32e..291ec3609 100644
--- a/lang/es/sidebar.php
+++ b/lang/es/sidebar.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
return [
'workspaces' => 'Workspaces',
'select_workspace' => 'Seleccionar workspace',
diff --git a/lang/pt-BR/automations.php b/lang/pt-BR/automations.php
index 411783843..828398e99 100644
--- a/lang/pt-BR/automations.php
+++ b/lang/pt-BR/automations.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
return [
'title' => 'Automações',
'default_name' => 'Nova automação',
diff --git a/lang/pt-BR/sidebar.php b/lang/pt-BR/sidebar.php
index 73cbcad0b..e4178c6e2 100644
--- a/lang/pt-BR/sidebar.php
+++ b/lang/pt-BR/sidebar.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
return [
'workspaces' => 'Espaços de trabalho',
'select_workspace' => 'Selecionar workspace',
diff --git a/tests/Feature/Automation/AutomationEncryptionTest.php b/tests/Feature/Automation/AutomationEncryptionTest.php
index 892c6fc40..6109d6db9 100644
--- a/tests/Feature/Automation/AutomationEncryptionTest.php
+++ b/tests/Feature/Automation/AutomationEncryptionTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Http\Resources\AutomationResource;
use App\Models\Automation;
use Illuminate\Support\Facades\Crypt;
diff --git a/tests/Feature/Automation/AutomationModelTest.php b/tests/Feature/Automation/AutomationModelTest.php
index 2bbcc7491..437c1af15 100644
--- a/tests/Feature/Automation/AutomationModelTest.php
+++ b/tests/Feature/Automation/AutomationModelTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Enums\Automation\Status;
use App\Models\Automation;
use App\Models\AutomationNodeRun;
diff --git a/tests/Feature/Automation/Node/ConditionNodeTest.php b/tests/Feature/Automation/Node/ConditionNodeTest.php
index e0aff7388..6a7250ef1 100644
--- a/tests/Feature/Automation/Node/ConditionNodeTest.php
+++ b/tests/Feature/Automation/Node/ConditionNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunConditionNode;
use App\Models\AutomationRun;
diff --git a/tests/Feature/Automation/Node/DelayNodeTest.php b/tests/Feature/Automation/Node/DelayNodeTest.php
index 888eef3bc..6234fc71c 100644
--- a/tests/Feature/Automation/Node/DelayNodeTest.php
+++ b/tests/Feature/Automation/Node/DelayNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunDelayNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;
diff --git a/tests/Feature/Automation/Node/EndNodeTest.php b/tests/Feature/Automation/Node/EndNodeTest.php
index 7fb95f19e..88756d8de 100644
--- a/tests/Feature/Automation/Node/EndNodeTest.php
+++ b/tests/Feature/Automation/Node/EndNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunEndNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;
diff --git a/tests/Feature/Automation/Node/FetchRssNodeTest.php b/tests/Feature/Automation/Node/FetchRssNodeTest.php
index 9f86c1fdd..dd23a682b 100644
--- a/tests/Feature/Automation/Node/FetchRssNodeTest.php
+++ b/tests/Feature/Automation/Node/FetchRssNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunFetchRssNode;
use App\Enums\Automation\NodeRun\Status as NodeRunStatus;
use App\Jobs\Automation\ProcessAutomationNode;
diff --git a/tests/Feature/Automation/Node/GenerateNodeTest.php b/tests/Feature/Automation/Node/GenerateNodeTest.php
index e2ee03459..38aa47ed8 100644
--- a/tests/Feature/Automation/Node/GenerateNodeTest.php
+++ b/tests/Feature/Automation/Node/GenerateNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunGenerateNode;
use App\Ai\Agents\PostContentGenerator;
use App\Ai\Agents\PostContentHumanizer;
diff --git a/tests/Feature/Automation/Node/HttpRequestNodeTest.php b/tests/Feature/Automation/Node/HttpRequestNodeTest.php
index 48ec872fe..3cc340238 100644
--- a/tests/Feature/Automation/Node/HttpRequestNodeTest.php
+++ b/tests/Feature/Automation/Node/HttpRequestNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunHttpRequestNode;
use App\Enums\Automation\NodeRun\Status as NodeRunStatus;
use App\Jobs\Automation\ProcessAutomationNode;
diff --git a/tests/Feature/Automation/Node/PublishNodeTest.php b/tests/Feature/Automation/Node/PublishNodeTest.php
index feea3d35f..73a5d57bb 100644
--- a/tests/Feature/Automation/Node/PublishNodeTest.php
+++ b/tests/Feature/Automation/Node/PublishNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunPublishNode;
use App\Enums\Post\Status as PostStatus;
use App\Jobs\PublishPost;
diff --git a/tests/Feature/Automation/Node/WebhookNodeTest.php b/tests/Feature/Automation/Node/WebhookNodeTest.php
index aa79d9e87..2bb14eb84 100644
--- a/tests/Feature/Automation/Node/WebhookNodeTest.php
+++ b/tests/Feature/Automation/Node/WebhookNodeTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Node\RunWebhookNode;
use App\Enums\Automation\NodeRun\Status;
use App\Models\AutomationRun;
diff --git a/tests/Feature/Automation/Run/RunLifecycleTest.php b/tests/Feature/Automation/Run/RunLifecycleTest.php
index e09fe1ebb..dc48fc77e 100644
--- a/tests/Feature/Automation/Run/RunLifecycleTest.php
+++ b/tests/Feature/Automation/Run/RunLifecycleTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\TriggerItem\EnrollTriggerItem;
use App\Ai\Agents\PostContentGenerator;
use App\Ai\Agents\PostContentHumanizer;
diff --git a/tests/Feature/Automation/Run/TestAutomationTest.php b/tests/Feature/Automation/Run/TestAutomationTest.php
index c4b830322..1691700be 100644
--- a/tests/Feature/Automation/Run/TestAutomationTest.php
+++ b/tests/Feature/Automation/Run/TestAutomationTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Run\TestAutomation;
use App\Enums\Automation\Run\Status;
use App\Enums\Post\Status as PostStatus;
diff --git a/tests/Feature/Automation/Trigger/PostTriggersTest.php b/tests/Feature/Automation/Trigger/PostTriggersTest.php
index 9733c27bf..9d0b21917 100644
--- a/tests/Feature/Automation/Trigger/PostTriggersTest.php
+++ b/tests/Feature/Automation/Trigger/PostTriggersTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Enums\Post\Status as PostStatus;
use App\Jobs\Automation\ProcessAutomationNode;
use App\Models\Automation;
diff --git a/tests/Feature/Automation/Trigger/ScheduleTest.php b/tests/Feature/Automation/Trigger/ScheduleTest.php
index 8132b0a8a..b5b3686dd 100644
--- a/tests/Feature/Automation/Trigger/ScheduleTest.php
+++ b/tests/Feature/Automation/Trigger/ScheduleTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Actions\Automation\Trigger\FireScheduleTrigger;
use App\Models\Automation;
use App\Models\AutomationTriggerItem;
diff --git a/tests/Unit/Automation/ExpressionResolverTest.php b/tests/Unit/Automation/ExpressionResolverTest.php
index 72116ff70..cbdb2f4aa 100644
--- a/tests/Unit/Automation/ExpressionResolverTest.php
+++ b/tests/Unit/Automation/ExpressionResolverTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use App\Services\Automation\ExpressionResolver;
beforeEach(function () {