rua_entrega, $this->numero_entrega - $this->bairro_entrega - $this->cidade_entrega"; } public function itens(){ return $this->hasMany(ItemPedidoEcommerce::class, 'pedido_id'); } public function cliente(){ return $this->belongsTo(Cliente::class, 'cliente_id'); } public function _estado(){ if($this->estado == 'novo'){ return "
NOVO
"; }else if($this->estado == 'preparando'){ return "
PREPARANDO
"; }else if($this->estado == 'em_trasporte'){ return "
EM TRANSPORTE
"; }else if($this->estado == 'finalizado'){ return "
FINALIZADO
"; }else{ return "
RECUSADO
"; } } public static function estados(){ return [ 'novo' => 'Novo', 'aprovado' => 'Aprovado', 'em_trasporte' => 'Em transporte', 'finalizado' => 'Finalizado', 'recusado' => 'Recusado' ]; } }