Skip to content

Insert a Row

Gilberto Junior edited this page Dec 4, 2019 · 2 revisions

This method creates a new entry.

Syntax

public function create(array $data): Model;

Example

$instance = $repository->create([
    'name' => 'Joe Doe',
    'email' => '[email protected]',
]);

echo 'User #' . $user->id . ' created';

🡄 Creating Caching Repositories | Update a Row 🡆