Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Bottelet/DaybydayCRM

2311 stars
2 code files
View Bottelet/DaybydayCRM on GitHub

app/Http/Controllers/OffersController.php

Open in 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();
}
//
}

app/Http/Controllers/ProjectsController.php

Open in 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);
}
 
//
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.