Fix on invoices, add delivery reference, wip on dashboard concurrency requests designed on template
This commit is contained in:
@@ -13,9 +13,13 @@ class HomeController extends Controller
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function index()
|
||||
public function index(Request $request, $period = false)
|
||||
{
|
||||
$data = Dashboards::getStats();
|
||||
$data = $request->all();
|
||||
$start = $request->input('start');
|
||||
$end = $request->input('end');
|
||||
$data = Dashboards::getStats($start, $end);
|
||||
// dump($data);
|
||||
return view('Admin.Shop.Dashboard.index', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,33 +5,20 @@ namespace App\Http\Controllers\Admin\Shop;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
use App\Repositories\Shop\Dashboards;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
if (Users::hasRole('admin')) {
|
||||
$dashboard = 'dashboard';
|
||||
$data = [];
|
||||
}
|
||||
$data = $request->all();
|
||||
$data = Dashboards::getStats($data);
|
||||
dump($data);
|
||||
|
||||
return view('Admin.Shop.Dashboard.index', $data);
|
||||
}
|
||||
|
||||
@@ -28,18 +28,19 @@ class InvoiceController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Invoices::get($id);
|
||||
$data['invoice'] = Invoices::get($id)->toArray();
|
||||
return view('Admin.Shop.Invoices.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Invoices::get($id)->toArray();
|
||||
$data['invoice'] = Invoices::get($id, ['order.customer', 'order.address', 'order.detail'])->toArray();
|
||||
$data['statuses'] = Invoices::statuses();
|
||||
return view('Admin.Shop.Invoices.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Invoices::destroy($id);
|
||||
return Invoices::delete($id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user