public function testRoute() { $customer = Customer::whereEmail('*****@*****.**')->first(); $token1 = JWTAuth::attempt(["email" => '*****@*****.**', "password" => "admin"]); $token2 = JWTAuth::fromUser($customer); $access_token = $token1; $response = $this->call('GET', '/testtoken', [], [], array('HTTP_authorization' => 'bearer ' . $access_token, "HTTP_custom" => "custom header")); $this->assertTrue($response->isOk()); }
public function destroy($id) { return DB::transaction(function ($id) use($id) { $customer = Customer::find($id); if (!$customer) { return; } $customer->address_id = null; $customer->save(); $customer->addresses()->delete(); $customer->delete(); }); }