PHP code example of vildanbina / laravel-model-json
1. Go to this page and download the library: Download vildanbina/laravel-model-json 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/ */
vildanbina / laravel-model-json example snippets
public function scopeVerified(Builder $query): void
{
$query->whereNotNull('email_verified_at');
}
public function scopeByEmail(Builder $query, string $email): void
{
$query->where('email', $email);
}
bash
php artisan model:export User
bash
php artisan model:export App\Models\User
bash
php artisan model:export User --path=public
bash
php artisan model:export User --filename=data
bash
php artisan model:export User --except-fields=id,deleted_at
bash
php artisan model:export User --without-timestamps
bash
php artisan model:export User --without-global-scopes
bash
php artisan model:export User --with-hidden
bash
php artisan model:export User --only-fields=name,email
bash
php artisan model:export Post --forget-data=comments.*.moderated_at
bash
php artisan model:export User --scope=verified