PHP code example of bjnstnkvc / builder-make-command
1. Go to this page and download the library: Download bjnstnkvc/builder-make-command library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bjnstnkvc / builder-make-command example snippets
use Bjnstnkvc\BuilderMakeCommand\Concerns\HasDynamicBuilder;
class User extends Model
{
use HasDynamicBuilder;
}
User::whereId(mixed $operator = null, mixed $value = null, string $boolean = 'and');
User::whereIdNot(mixed $operator = null, mixed $value = null, string $boolean = 'and');
User::whereIdIn(array $values, string $boolean = 'and', bool $not = false);
User::whereIdNotIn(array $values, string $boolean = 'and');
User::whereIdLike(string $value, bool $caseSensitive = false, string $boolean = 'and', bool $not = false);
User::whereIdNotLike(string $value, bool $caseSensitive = false, string $boolean = 'and', bool $not = false);
User::orWhereId(mixed $operator = null, mixed $value = null);
User::orWhereIdNot(mixed $operator = null, mixed $value = null);
User::orWhereIdIn(array $values);
User::orWhereIdNotIn(array $values);
User::orWhereIdLike(string $value, bool $caseSensitive = false);
User::orWhereIdNotLike(string $value, bool $caseSensitive = false);
// Methods for other database columns.
User::whereId(1)
->orWhereNameNot('John')
->first();
User::whereId('>', 1)
->orWhereEmail('[email protected] ')
->first();
use App\Models\Builders\UserBuilder;
User::whereName('John')
->where(function (UserBuilder $query) {
$query->whereEmail('[email protected] ')
->orWhereTitle('Admin');
})
->first();
bash
php artisan vendor:publish --provider="Bjnstnkvc\BuilderMakeCommand\BuilderMakeCommandServiceProvider" --tag=make-builder-config
bash
php artisan vendor:publish --provider="Bjnstnkvc\BuilderMakeCommand\BuilderMakeCommandServiceProvider" --tag=make-builder-stubs
bash
php artisan make:builder UserBuilder
bash
php artisan make:builder UserBuilder User
bash
php artisan make:builder UserBuilder User --force
bash
php artisan make:builder
bash
php artisan make:builder UserBuilder User --mixin