How to copy the found entry in laravel
$test = Test::find(1); Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
$copy = $test->replicate()
https://laravel.com/api/5.3/Illuminate/Database/Eloquent/Model.html#method_replicate
You can clone.
$copy = clone $test; But here it is necessary to take into account the possible magic type __clone, if described.
Source: https://ru.stackoverflow.com/questions/568176/
All Articles