Journal Entry, October 11th to October 18th 2019

October 18, 2019 · 1 min read

Laravel Nova

  1. Wed Oct 16

    • The can method is on the user as authorization always attaches to the current logged in user
    • The following specifies checking the sendReceipt() method in the OrderPolicy

      (new Actions\SendReceipt)->canSee(function ($request) {
          return $request->user()->can('sendReceipt', \App\Models\Order::class);
      })->canRun(function ($request, $order) {
          return $request->user()->can('sendReceipt', \App\Models\Order::class);
      }),