This commit is contained in:
philipp lang 2023-12-31 21:02:40 +01:00
parent 89b5cbd4b5
commit 9355daee7e
4 changed files with 9 additions and 3 deletions

View File

@ -46,6 +46,9 @@ class Group extends Model
}); });
} }
/**
* @return array<int, array{id: int, name: string}>
*/
public static function forSelect(?self $parent = null, string $prefix = ''): array public static function forSelect(?self $parent = null, string $prefix = ''): array
{ {
$result = self::where('parent_id', $parent ? $parent->id : null)->withCount('children')->get(); $result = self::where('parent_id', $parent ? $parent->id : null)->withCount('children')->get();

View File

@ -6,14 +6,14 @@ use App\Form\Models\Form;
use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Database\Eloquent\Factories\Factory;
/** /**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Form\Models\Form> * @extends Factory<Form>
*/ */
class FormFactory extends Factory class FormFactory extends Factory
{ {
/** /**
* The name of the factory's corresponding model. * The name of the factory's corresponding model.
* *
* @var string * @var class-string<Form>
*/ */
protected $model = Form::class; protected $model = Form::class;

View File

@ -6,6 +6,8 @@ use Worksome\RequestFactories\RequestFactory;
/** /**
* @method self name(string $name) * @method self name(string $name)
* @method self description(string $description)
* @method self excerpt(string $description)
*/ */
class FormRequest extends RequestFactory class FormRequest extends RequestFactory
{ {
@ -17,6 +19,7 @@ class FormRequest extends RequestFactory
return [ return [
'name' => $this->faker->words(4, true), 'name' => $this->faker->words(4, true),
'description' => $this->faker->text(), 'description' => $this->faker->text(),
'excerpt' => $this->faker->words(10, true),
'config' => ['sections' => []], 'config' => ['sections' => []],
]; ];
} }

View File

@ -5,8 +5,8 @@ namespace Illuminate\Testing;
use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\File\File;
/** /**
* @method self assertInertiaPath(string $path, string|array<string, mixed>|int|null $value)
* @method self assertInertiaCount(string $path, int $count) * @method self assertInertiaCount(string $path, int $count)
* @method self assertInertiaPath(string $path, mixed $value)
* @method self assertPdfPageCount(int $count) * @method self assertPdfPageCount(int $count)
* @method self assertPdfName(string $filename) * @method self assertPdfName(string $filename)
* @method File getFile() * @method File getFile()