xmrmemes/database/factories/TipFactory.php

32 lines
747 B
PHP
Raw Normal View History

2021-07-16 02:35:54 -04:00
<?php
namespace Database\Factories;
use App\Models\Tip;
use App\Models\Meme;
use Illuminate\Database\Eloquent\Factories\Factory;
class TipFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Tip::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'meme_id' => Meme::all()->random()->id,
'amount' => $this->faker->randomFloat($nbMaxDecimals = NULL, $min = 0, $max = 1),
'tx' => $this->faker->bothify('??#?#?###??#???#?#?###??#???#?#?###??#???#?#?###??#??##??#?#?###??#???#?#?###??#???#?#?###??#??'),
];
}
}