src/Http/Controllers/TeamController.php
public function delete($id)
    {
        $entry = WinkAuthor::findOrFail($id);

        if ($entry->posts()->count()) {
            return response()->json(['message' => 'Please remove the author\'s posts first.'], 402);
        }

        if ($entry->id == auth('wink')->user()->id) {
            return response()->json(['message' => 'You cannot delete yourself.'], 402);
        }

        $entry->delete();
    }
public function delete($id)
    {
        $entry = WinkAuthor::findOrFail($id);

        if ($entry->posts()->count()) {
            return response()->json(['message' => 'Please remove the author\'s posts first.'], 402);
        }

        if ($entry->id == auth('wink')->user()->id) {
            return response()->json(['message' => 'You cannot delete yourself.'], 402);
        }

        $entry->delete();
    }
public function delete ( $ id ) { $ entry = WinkAuthor :: findOrFail ( $ id ) ; if ( $ entry -> posts ( ) -> count ( ) ) { return response ( ) -> json ( [ 'message' => 'Please remove the author\'s posts first.' ] , 402 ) ; } if ( $ entry -> id == auth ( 'wink' ) -> user ( ) -> id ) { return response ( ) -> json ( [ 'message' => 'You cannot delete yourself.' ] , 402 ) ; } $ entry -> delete ( ) ; }
Return a single author.

@param  string  $id
@return \Illuminate\Http\JsonResponse|null
Return a single author .