Create a new Eloquent model instance.
public __construct ( array $attributes = [] ) : void | ||
$attributes | array | |
return | void |
use Illuminate\Database\Eloquent\Model; class Post extends Model { // Model logic here } $post = new Post(['title' => 'My first post', 'content' => 'This is the content of my first post']);
$post = new Post(['title' => 'My first post']); $post->__construct(['content' => 'This is the content of my first post']);The `Illuminate\Database\Eloquent\Model` package library provides a simple and intuitive way to work with databases in your PHP applications.
public __construct ( array $attributes = [] ) : void | ||
$attributes | array | |
return | void |