customer.php 523 B

12345678910111213141516171819202122232425
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. use RuntimeException;
  4. /**
  5. * @var int $id
  6. */
  7. $customer = Customer::get($id);
  8. if(!$customer) {
  9. throw new RuntimeException(__("Customer not found."));
  10. }
  11. $core = Core::getInstance();
  12. $core->addBreadcrumb("/customers", __("Customers"));
  13. $core->addBreadcrumb($customer->getUrl(), $customer->name);
  14. $user = $core->getUser();
  15. $user->requireAdmin();
  16. View::include("header");
  17. View::include("customer", compact("customer"));
  18. View::include("footer");