Created
August 7, 2019 15:42
-
-
Save henriqueweiand/2fc623f8c29acff5a4ac20a176a801a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Messages extends Model { | |
protected $fillable = [ | |
"id", | |
"user_id", | |
"description", | |
"created_at", | |
"updated_at" | |
]; | |
public static $rules = [ | |
"user_id" => "required|numeric|exists:users,id", | |
"description" => "required|max:255", | |
]; | |
public function user() | |
{ | |
return $this->belongsTo("App\Users"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment