Answers for "model replication"

0

model replication

use App\Models\Address;

$shipping = Address::create([
    'type' => 'shipping',
    'line_1' => '123 Example Street',
    'city' => 'Victorville',
    'state' => 'CA',
    'postcode' => '90001',
]);

$billing = $shipping->replicate()->fill([
    'type' => 'billing'
]);

$billing->save();
Posted by: Guest on July-24-2021

Code answers related to "model replication"

Browse Popular Code Answers by Language