80700/how-manually-create-new-empty-eloquent-collection-laravel
Hello @kartik,
It's not really Eloquent, to add an Eloquent model to your collection you have some options:
In Laravel 5 you can benefit from a helper
$c = collect(new Post);
or
$c = collect(); $c->add(new Post);
Hope it helps!! Thank You!
Hello @kartik, The code below solved my problem: $messages ...READ MORE
Hello @kartik, You can use less code, writing ...READ MORE
Hello @kartik, Try using this code: public function up() ...READ MORE
Hello @kartik, If you have a collection you ...READ MORE
Hey @kartik, First you have to go to ...READ MORE
Named route is used to give specific ...READ MORE
Hello, This is simple you just need to ...READ MORE
Hey @kartik, Named routing is another amazing feature of ...READ MORE
We need to create a new model ...READ MORE
You need do little modification in your ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.