Aronaman
3 months ago
317
3
Laravel

Maximum execution time of 60 seconds exceeded

Posted 3 months ago by Aronaman

Room.php

 protected $appends = [
        'room_gallery',
        'room_feature_image', 
        'dollar_room_price',
        'birr_room_price', 
    ];


  public function getDollarRoomPriceAttribute()
        {
            if($this->organization->currency->symbol=='ETB'){
                $dollarRate=Currency::where('currencyType','ETB')->first()->exchangeRate;//0.029
                $fromEtbToUsd=$this->room_price *$dollarRate;
                return $fromEtbToUsd;       
            }

        }


        public function getBirrRoomPriceAttribute()
        {
            if($this->organization->currency->symbol=='USD'){

                $etbRate=Currency::where('currencyType','USD')->first()->exchangeRate; //33.38
                $fromUsdToEtb=$this->room_price *$etbRate;
                return $fromEtbToUsd;
            }
        } 

conroller

public function roomIndex()
   {
   	
   	 $listRooms =Room::withCount('individualRooms')->paginate(30);
          dd($listRooms); // noting dollar_room_price or birr_room_price
   	 return view('list_rooms', compact('listRooms'));
   }

what is wrong?? any help, thanks

Please sign in or create an account to participate in this conversation.