Customer Mail, Mails, Views Lead Customer
This commit is contained in:
parent
f1e0900a7a
commit
f53f17f9c1
46 changed files with 2217 additions and 1489 deletions
86
app/Http/Controllers/CustomerController.php
Executable file
86
app/Http/Controllers/CustomerController.php
Executable file
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Repositories\CustomerRepository;
|
||||
use Carbon;
|
||||
use Request;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
|
||||
protected $customerRepo;
|
||||
|
||||
public function __construct(CustomerRepository $customerRepo)
|
||||
{
|
||||
$this->middleware('admin');
|
||||
$this->customerRepo = $customerRepo;
|
||||
}
|
||||
|
||||
public function index($step = false)
|
||||
{
|
||||
$data = [
|
||||
'step' => $step
|
||||
];
|
||||
return view('customer.index', $data);
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
if($id === "new") {
|
||||
$customer = new Customer();
|
||||
$id = 'new';
|
||||
|
||||
}else{
|
||||
$customer = Customer::findOrFail($id);
|
||||
$id = $customer->id;
|
||||
}
|
||||
$data = [
|
||||
'customer' => $customer,
|
||||
'id' => $id,
|
||||
];
|
||||
return view('customer.detail', $data);
|
||||
|
||||
}
|
||||
|
||||
public function store($id)
|
||||
{
|
||||
return back();
|
||||
/* $data = Request::all();
|
||||
|
||||
\Session()->flash('alert-save', '1');
|
||||
return redirect(route('lead_detail', [$lead->id]));*/
|
||||
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
/*
|
||||
\Session()->flash('alert-success', __('Eintrag gelöscht'));
|
||||
return redirect(route('lead_detail', [$lead->id]));*/
|
||||
}
|
||||
|
||||
public function getCustomers()
|
||||
{
|
||||
$query = Customer::with('salutation');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
->addColumn('action_edit', function (Customer $customer) {
|
||||
return '<a href="'.route('customer_detail', [$customer->id]).'" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('id', function (Customer $customer) {
|
||||
return '<a data-order="'.$customer->id.'" href="'.route('customer_detail', [$customer->id]).'" data-id="'.$customer->id.'">'.$customer->id.'</a>';
|
||||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->filterColumn('id', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('id', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->rawColumns(['action_edit', 'id'])
|
||||
->make(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue