From 1fa67e12609514f691eded34b9cda04871ea7313 Mon Sep 17 00:00:00 2001 From: "kreaweb.be" Date: Wed, 31 Jul 2024 11:57:20 +0200 Subject: [PATCH] Added ...TrimStringsAndConvertEmptyStringsToNull --- _ide_helper.php | 39 ++++++++++++++++--- app/Livewire/Gedcom/Import.php | 4 +- app/Livewire/People/Add/Child.php | 2 + app/Livewire/People/Add/Father.php | 2 + app/Livewire/People/Add/Mother.php | 2 + app/Livewire/People/Add/Partner.php | 2 + app/Livewire/People/Add/Person.php | 2 + app/Livewire/People/Edit/Contact.php | 2 + app/Livewire/People/Edit/Death.php | 2 + app/Livewire/People/Edit/Family.php | 2 + app/Livewire/People/Edit/Partner.php | 2 + app/Livewire/People/Edit/Profile.php | 2 + ...rimStringsAndConvertEmptyStringsToNull.php | 20 ++++++++++ 13 files changed, 76 insertions(+), 7 deletions(-) create mode 100644 app/Livewire/Traits/TrimStringsAndConvertEmptyStringsToNull.php diff --git a/_ide_helper.php b/_ide_helper.php index fc75582e..01865d02 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -5,7 +5,7 @@ /** * A helper file for Laravel, to provide autocomplete information to your IDE - * Generated for Laravel 11.18.1. + * Generated for Laravel 11.19.0. * * This file should not be included in your code, only analyzed by your IDE! * @@ -25176,7 +25176,7 @@ class Eloquent extends \Illuminate\Database\Eloquent\Model { /** * Add a "where like" clause to the query. * - * @param string $column + * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean @@ -25191,7 +25191,7 @@ class Eloquent extends \Illuminate\Database\Eloquent\Model { /** * Add an "or where like" clause to the query. * - * @param string $column + * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return \Illuminate\Database\Query\Builder @@ -25204,7 +25204,7 @@ class Eloquent extends \Illuminate\Database\Eloquent\Model { /** * Add a "where not like" clause to the query. * - * @param string $column + * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean @@ -25218,7 +25218,7 @@ class Eloquent extends \Illuminate\Database\Eloquent\Model { /** * Add an "or where not like" clause to the query. * - * @param string $columns + * @param \Illuminate\Contracts\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return \Illuminate\Database\Query\Builder @@ -25978,7 +25978,7 @@ class Eloquent extends \Illuminate\Database\Eloquent\Model { return $instance->orWhereAll($columns, $operator, $value); } /** - * Add an "where" clause to the query for multiple columns with "or" conditions between them. + * Add a "where" clause to the query for multiple columns with "or" conditions between them. * * @param string[] $columns * @param string $operator @@ -26003,6 +26003,33 @@ class Eloquent extends \Illuminate\Database\Eloquent\Model { { /** @var \Illuminate\Database\Query\Builder $instance */ return $instance->orWhereAny($columns, $operator, $value); + } + /** + * Add a "where not" clause to the query for multiple columns where none of the conditions should be true. + * + * @param string[] $columns + * @param string $operator + * @param mixed $value + * @param string $boolean + * @return \Illuminate\Database\Query\Builder + * @static + */ public static function whereNone($columns, $operator = null, $value = null, $boolean = 'and') + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->whereNone($columns, $operator, $value, $boolean); + } + /** + * Add an "or where not" clause to the query for multiple columns where none of the conditions should be true. + * + * @param string[] $columns + * @param string $operator + * @param mixed $value + * @return \Illuminate\Database\Query\Builder + * @static + */ public static function orWhereNone($columns, $operator = null, $value = null) + { + /** @var \Illuminate\Database\Query\Builder $instance */ + return $instance->orWhereNone($columns, $operator, $value); } /** * Add a "group by" clause to the query. diff --git a/app/Livewire/Gedcom/Import.php b/app/Livewire/Gedcom/Import.php index bb6e6ad7..4ffd7348 100644 --- a/app/Livewire/Gedcom/Import.php +++ b/app/Livewire/Gedcom/Import.php @@ -4,8 +4,9 @@ namespace App\Livewire\Gedcom; -use Illuminate\View\View; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; // use Laravel\Jetstream\Events\AddingTeam; +use Illuminate\View\View; use Livewire\Component; use Livewire\Features\SupportFileUploads\TemporaryUploadedFile; use Livewire\WithFileUploads; @@ -14,6 +15,7 @@ class Import extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; use WithFileUploads; // ----------------------------------------------------------------------- diff --git a/app/Livewire/People/Add/Child.php b/app/Livewire/People/Add/Child.php index c211e922..2abb6ba0 100644 --- a/app/Livewire/People/Add/Child.php +++ b/app/Livewire/People/Add/Child.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Add; use App\Livewire\Forms\People\ChildForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use App\PersonPhotos; use Illuminate\Http\UploadedFile; @@ -18,6 +19,7 @@ class Child extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; use WithFileUploads; // ----------------------------------------------------------------------- diff --git a/app/Livewire/People/Add/Father.php b/app/Livewire/People/Add/Father.php index da07fb73..c0fde30f 100644 --- a/app/Livewire/People/Add/Father.php +++ b/app/Livewire/People/Add/Father.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Add; use App\Livewire\Forms\People\FatherForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use App\PersonPhotos; use Illuminate\Http\UploadedFile; @@ -18,6 +19,7 @@ class Father extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; use WithFileUploads; // ----------------------------------------------------------------------- diff --git a/app/Livewire/People/Add/Mother.php b/app/Livewire/People/Add/Mother.php index 70864662..e2a989f8 100644 --- a/app/Livewire/People/Add/Mother.php +++ b/app/Livewire/People/Add/Mother.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Add; use App\Livewire\Forms\People\MotherForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use App\PersonPhotos; use Illuminate\Http\UploadedFile; @@ -18,6 +19,7 @@ class Mother extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; use WithFileUploads; // ----------------------------------------------------------------------- diff --git a/app/Livewire/People/Add/Partner.php b/app/Livewire/People/Add/Partner.php index 512d414e..75479f2c 100644 --- a/app/Livewire/People/Add/Partner.php +++ b/app/Livewire/People/Add/Partner.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Add; use App\Livewire\Forms\People\PartnerForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Couple; use App\Models\Person; use App\PersonPhotos; @@ -19,6 +20,7 @@ class Partner extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; use WithFileUploads; // ----------------------------------------------------------------------- diff --git a/app/Livewire/People/Add/Person.php b/app/Livewire/People/Add/Person.php index a4ba0051..3ef37cf2 100644 --- a/app/Livewire/People/Add/Person.php +++ b/app/Livewire/People/Add/Person.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Add; use App\Livewire\Forms\People\PersonForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\PersonPhotos; use Illuminate\Http\UploadedFile; use Illuminate\Support\Arr; @@ -16,6 +17,7 @@ class Person extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; use WithFileUploads; // ----------------------------------------------------------------------- diff --git a/app/Livewire/People/Edit/Contact.php b/app/Livewire/People/Edit/Contact.php index cd7bc59d..492d9b56 100644 --- a/app/Livewire/People/Edit/Contact.php +++ b/app/Livewire/People/Edit/Contact.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Edit; use App\Livewire\Forms\People\ContactForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use Illuminate\View\View; use Livewire\Component; @@ -13,6 +14,7 @@ class Contact extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; // ----------------------------------------------------------------------- public Person $person; diff --git a/app/Livewire/People/Edit/Death.php b/app/Livewire/People/Edit/Death.php index be0e146f..c6f09ed0 100644 --- a/app/Livewire/People/Edit/Death.php +++ b/app/Livewire/People/Edit/Death.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Edit; use App\Livewire\Forms\People\DeathForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use Carbon\Carbon; use Illuminate\View\View; @@ -14,6 +15,7 @@ class Death extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; // ----------------------------------------------------------------------- public Person $person; diff --git a/app/Livewire/People/Edit/Family.php b/app/Livewire/People/Edit/Family.php index ba1bccdc..4412f062 100644 --- a/app/Livewire/People/Edit/Family.php +++ b/app/Livewire/People/Edit/Family.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Edit; use App\Livewire\Forms\People\FamilyForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Couple; use App\Models\Person; use Illuminate\Support\Collection; @@ -15,6 +16,7 @@ class Family extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; // ----------------------------------------------------------------------- public $person; diff --git a/app/Livewire/People/Edit/Partner.php b/app/Livewire/People/Edit/Partner.php index baff21a5..6fa444ce 100644 --- a/app/Livewire/People/Edit/Partner.php +++ b/app/Livewire/People/Edit/Partner.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Edit; use App\Livewire\Forms\People\PartnerForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use Illuminate\Support\Collection; use Illuminate\View\View; @@ -14,6 +15,7 @@ class Partner extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; // ----------------------------------------------------------------------- public $person; diff --git a/app/Livewire/People/Edit/Profile.php b/app/Livewire/People/Edit/Profile.php index 5172a2d5..89ba8b24 100644 --- a/app/Livewire/People/Edit/Profile.php +++ b/app/Livewire/People/Edit/Profile.php @@ -5,6 +5,7 @@ namespace App\Livewire\People\Edit; use App\Livewire\Forms\People\ProfileForm; +use App\Livewire\Traits\TrimStringsAndConvertEmptyStringsToNull; use App\Models\Person; use Carbon\Carbon; use Illuminate\View\View; @@ -14,6 +15,7 @@ class Profile extends Component { use Interactions; + use TrimStringsAndConvertEmptyStringsToNull; // ----------------------------------------------------------------------- public Person $person; diff --git a/app/Livewire/Traits/TrimStringsAndConvertEmptyStringsToNull.php b/app/Livewire/Traits/TrimStringsAndConvertEmptyStringsToNull.php new file mode 100644 index 00000000..23375d02 --- /dev/null +++ b/app/Livewire/Traits/TrimStringsAndConvertEmptyStringsToNull.php @@ -0,0 +1,20 @@ +