Laracasts\Flash\FlashNotifier::error PHP Method

error() public method

Flash an error message.
public error ( string $message )
$message string
    public function error($message)
    {
        $this->message($message, 'danger');
        return $this;
    }

Usage Example

 public function destroy($id, FlashNotifier $notifier)
 {
     $trip = Trip::findOrFail($id);
     if ($trip->passengers()->count() > 0) {
         $notifier->error('That trip already has passengers. No way we can delete it...');
         return back();
     }
     $trip->delete();
     $notifier->success('Trip successfully deleted!');
     return back();
 }
All Usage Examples Of Laracasts\Flash\FlashNotifier::error