Example of Collection Methods: Push in Bottelet/DaybydayCRM

File app/Http/Controllers/OffersController.php (link to Github)
class OffersController extends Controller
{
    //
    public function won(Request $request)
    {
        $offer = Offer::whereExternalId($request->get('offer_external_id'))->with('invoiceLines')->firstOrFail();
        //
        $lines = $offer->invoiceLines;
        $newLines = collect();
        foreach($lines as $invoiceLine) {
            $invoiceLine->offer_id = null;
            $newLines->push(InvoiceLine::make($invoiceLine->toArray()));
        }
  
        $invoice->invoiceLines()->saveMany($newLines);
        
        return redirect()->back();
    }
    //
}
File app/Http/Controllers/ProjectsController.php (link to Github)
class ProjectsController extends Controller
{
    //
    public function show(Project $project)
    {
        //
        $collaborators = collect();

        $collaborators->push($project->assignee);
        foreach ($project->tasks as $task) {
            $collaborators->push($task->user);
        }

        //
    }
    //
}