Lavet sådan at man kan adde information til contacts databasen

This commit is contained in:
Neerholt 2020-06-29 11:14:07 +02:00
parent 419672a302
commit ba73440044
3 changed files with 8 additions and 3 deletions

View File

@ -7,6 +7,6 @@ use Illuminate\Database\Eloquent\Model;
class Contact extends Model class Contact extends Model
{ {
protected $fillable = [ protected $fillable = [
'name_first', "name_last", 'email', 'tel' 'name_first', "name_last", 'email', 'phone'
]; ];
} }

View File

@ -44,7 +44,7 @@ class ContactController extends Controller
"name_first" => "required|max:255", "name_first" => "required|max:255",
"name_last" => "required|max:255", "name_last" => "required|max:255",
"email" => "required|max:255", "email" => "required|max:255",
"tel" => "required|max:255", "phone" => "required|max:255",
]); ]);
$contact = new Contact($requestContact); $contact = new Contact($requestContact);

View File

@ -13,9 +13,14 @@ class CreateContact extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('contact', function (Blueprint $table) { Schema::create('contacts', function (Blueprint $table) {
$table->id(); $table->id();
$table->timestamps(); $table->timestamps();
$table->string('name_first', 255);
$table->string('name_last', 255);
$table->string('email', 255);
$table->integer('phone');
//$table->unique('email');
}); });
} }