1. Go to this page and download the library: Download wali/smart-seeder 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/ */
wali / smart-seeder example snippets
ali\SmartSeeder\SmartSeeder;
// Generate a random Arabic first name
echo SmartSeeder::name(); // e.g., "أحمد"
// Generate a random Arabic full name
echo SmartSeeder::fullName(); // e.g., "فاطمة الأنصاري"
// Generate a Hijri date
echo SmartSeeder::hijriDate(); // e.g., "1445/03/15"
// Generate a Saudi IBAN
echo SmartSeeder::iban(); // e.g., "SA0380000000608010167519"
// Generate a Saudi mobile number
echo SmartSeeder::phone(); // e.g., "+966501234567"
// Generate a Saudi National ID
echo SmartSeeder::nationalId(); // e.g., "1023456789"
// Generate a Saudi Iqama (resident ID)
echo SmartSeeder::iqama(); // e.g., "2087654321"
// Random name (male or female)
$name = SmartSeeder::name();
// Specific gender
$maleName = SmartSeeder::name('male'); // وليد, أحمد, خالد, محمد
$femaleName = SmartSeeder::name('female'); // فاطمة, مريم, سارة, نورة
// Full names with family names
$fullName = SmartSeeder::fullName();
$maleFullName = SmartSeeder::fullName('male');
$femaleFullName = SmartSeeder::fullName('female');
// Saudi IBAN (International Bank Account Number)
$iban = SmartSeeder::iban();
// Returns: "SA" + 22 digits (e.g., "SA0380000000608010167519")
// Saudi mobile phone number
$phone = SmartSeeder::phone();
// Returns: "+966" + 9 digits (e.g., "+966501234567")
// Saudi National ID (citizens and residents)
$nationalId = SmartSeeder::nationalId();
// Returns: 10-digit number starting with 1 or 2 (e.g., "1023456789")
// Saudi Iqama (resident ID) - specifically for non-citizens
$iqama = SmartSeeder::iqama();
// Returns: 10-digit number starting with 2 (e.g., "2087654321")
// In a Laravel Factory
use Wali\SmartSeeder\SmartSeeder;
$factory->define(User::class, function (Faker $faker) {
return [
'name' => SmartSeeder::fullName(),
'phone' => SmartSeeder::phone(),
'national_id' => SmartSeeder::nationalId(),
'iqama' => SmartSeeder::iqama(),
'iban' => SmartSeeder::iban(),
// ... other attributes
];
});
// In a Laravel Seeder
class UserSeeder extends Seeder
{
public function run()
{
for ($i = 0; $i < 100; $i++) {
User::create([
'name' => SmartSeeder::fullName(),
'phone' => SmartSeeder::phone(),
'national_id' => SmartSeeder::nationalId(),
]);
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.