feat: basic quotes request

This commit is contained in:
llama committed 2023-10-07 20:48:36 +11:00
1 parent 4fdff98580
commit a918600813
12 files changed
+165 -24

No files matched your search

@@ -102,6 +102,21 @@ class CreateUserCommand extends Command
hint: 'One will be randomly generated if non is provided',
);
// If we're not randomly generating one, let's make sure they're the same.
// If they fucked it up and don't know what the first password is they're fucked.
if (!empty($password)) {
password(
label: 'Confirm password?',
placeholder: '**********',
validate: function (string $value) use ($password) {
if ($value !== $password) {
return "Passwords don't match";
}
},
hint: 'One will be randomly generated if non is provided',
);
}
if (empty($password)) {
$password = Str::password(12);
$this->info("Randomly Generated Password: $password");
+4 -14
View File
@@ -3,23 +3,13 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Quote extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'last_used',
'quote',
'times_used',
];
use SoftDeletes;
protected $casts = [
'created_at' => 'datetime',
'last_used' => 'datetime',
'updated_at' => 'datetime',
protected $fillable = [
'quote',
];
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class RequestedQuotes extends Model
{
use SoftDeletes;
protected $fillable = [
'quote',
'user_id',
];
}