|
4 | 4 |
|
5 | 5 | namespace iamfarhad\LaravelAuditLog\Tests\Feature; |
6 | 6 |
|
7 | | -use Illuminate\Support\Facades\Config; |
| 7 | +use Illuminate\Support\Str; |
8 | 8 | use Illuminate\Support\Facades\DB; |
| 9 | +use Illuminate\Support\Facades\Config; |
9 | 10 | use Illuminate\Support\Facades\Schema; |
10 | | -use Illuminate\Support\Str; |
| 11 | +use iamfarhad\LaravelAuditLog\Tests\TestCase; |
11 | 12 | use iamfarhad\LaravelAuditLog\Tests\Mocks\Post; |
12 | 13 | use iamfarhad\LaravelAuditLog\Tests\Mocks\User; |
13 | | -use iamfarhad\LaravelAuditLog\Tests\TestCase; |
14 | 14 |
|
15 | 15 | final class AuditLogAdvancedTest extends TestCase |
16 | 16 | { |
17 | 17 | /** |
18 | 18 | * Get the latest audit log for the given model |
19 | | - * |
20 | | - * @param string $modelClass Class name of the model |
| 19 | + * |
| 20 | + * @param string $modelClass Class name of the model |
21 | 21 | * @return object|null The audit log record |
22 | 22 | */ |
23 | 23 | protected function getLatestAuditLog(string $modelClass): ?object |
24 | 24 | { |
25 | 25 | // Convert class name to table name (e.g., User -> audit_users_logs) |
26 | 26 | $className = class_basename($modelClass); |
27 | | - $tableName = 'audit_' . Str::snake(Str::plural($className)) . '_logs'; |
| 27 | + $tableName = 'audit_'.Str::snake(Str::plural($className)).'_logs'; |
28 | 28 |
|
29 | 29 | return DB::table($tableName) |
30 | 30 | ->latest('id') |
@@ -129,7 +129,7 @@ public function test_excluded_fields_from_different_sources(): void |
129 | 129 | // Create a user with all fields including test_field |
130 | 130 | Schema::table('users', function ($table) { |
131 | 131 | // Only add the column if it doesn't already exist |
132 | | - if (!Schema::hasColumn('users', 'test_field')) { |
| 132 | + if (! Schema::hasColumn('users', 'test_field')) { |
133 | 133 | $table->string('test_field')->nullable(); |
134 | 134 | } |
135 | 135 | }); |
|
0 commit comments