-
app/Http/Controllers/OffersController.php
Open in GitHubclass 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(); } // }
-
app/Http/Controllers/ProjectsController.php
Open in GitHubclass ProjectsController extends Controller { // public function show(Project $project) { // $collaborators = collect(); $collaborators->push($project->assignee); foreach ($project->tasks as $task) { $collaborators->push($task->user); } // } // }