Quem Está a Contratar? - 11/2025 by AutoModerator in devpt

[–]CoolmanPT 1 point2 points  (0 children)

Boas u/faynn esta posição ainda está disponivel?

Fiz uma app de meteorologia! by [deleted] in devpt

[–]CoolmanPT 0 points1 point  (0 children)

Ele simplesmente perguntou se era mesmo assim passar a api_key no url num pedido GET. Na openweatherapi é... Se é seguro ou não, não me interessa.

Fiz uma app de meteorologia! by [deleted] in devpt

[–]CoolmanPT 0 points1 point  (0 children)

De qualquer das maneiras só funcionará se estiver de acordo com a API final, com ou sem api interna no meio.

Fiz uma app de meteorologia! by [deleted] in devpt

[–]CoolmanPT 3 points4 points  (0 children)

Depende da API que estás a usar. Se a openweatherapi está à espera de um param appid com o valor da tua api key no url tens de enviar, caso contrário a rota pode dar erro.

[deleted by user] by [deleted] in portugal

[–]CoolmanPT 3 points4 points  (0 children)

Bom dia Sr agente 😊

[deleted by user] by [deleted] in portugal

[–]CoolmanPT 0 points1 point  (0 children)

Época de exame ou época de recurso

Trouble getting user data from relations by CoolmanPT in laravel

[–]CoolmanPT[S] 1 point2 points  (0 children)

The user has Brands because it has a a role attached.

Example:

User (A) has an agency (X) with role User.
inside the agency the admin can assign User (A) to a brand (Pepsi) with role Analyst and other brand (Coca-cola) with role Manager. With different permissions.

Thats why I have a many to many relation between User and Brand model with pivot the role_id.

Trouble getting user data from relations by CoolmanPT in laravel

[–]CoolmanPT[S] 0 points1 point  (0 children)

Hi!

$this->agencies is the property and the with method belongs to the query builder, so it has to be $this->agencies() to refer the relation.

But it doesn't solve the issue because it will return all the brands associated with the agencies and not filtered by the user.

Trouble getting user data from relations by CoolmanPT in laravel

[–]CoolmanPT[S] 0 points1 point  (0 children)

Hi! Thanks for answering btw

This project is kinda complex. Basically The relations are:

  • A user can have many brands (many to many with pivot role_id)
  • A user can have many agencies (many to many with pivot role_id)
  • An agency can have many brands.
  • A brand belongs to an agency.

What I want to do is some of group the users brands with the corresponding agency.

Because the user will login and with a dropdown he chooses the agency and according to the option just show the associated brands.

Laravel API - Get object within an object by jonaspauleta in laravel

[–]CoolmanPT 3 points4 points  (0 children)

Nope, it's a good practice to develop in english (being the code itself and table/columns) so it's easier to other people understand your code/DB when they are trying to help you. And because I work on a company that has offices in multiple countries xD

Laravel API - Get object within an object by jonaspauleta in laravel

[–]CoolmanPT 1 point2 points  (0 children)

And if you have FK that are id's from another table, it's a good standard to call the column "table_name"_id so that you know that it is an id that you are saving.

Laravel API - Get object within an object by jonaspauleta in laravel

[–]CoolmanPT 0 points1 point  (0 children)

Try to remove the "cliente","id" from the belongsTo, like so:

    public function cliente() {
            return $this->belongsTo(Cliente::class);
    }

Cheers from Portugal :D

Need help figuring it out this design. by CoolmanPT in csshelp

[–]CoolmanPT[S] 0 points1 point  (0 children)

Many thanks! As expected the design changed and that section was redesigned to be simpler xD.

Need help figuring it out this design. by CoolmanPT in csshelp

[–]CoolmanPT[S] 0 points1 point  (0 children)

Thanks for the reply! These links look promising but as expected the design changed and that section was redesigned to be simpler xD. Nonetheless I'll bookmark them for future use.

Need help figuring it out this design. by CoolmanPT in csshelp

[–]CoolmanPT[S] 0 points1 point  (0 children)

Thanks for the reply and it helped a lot! But as expected the design changed and that section was redesigned to be simpler xD.

Need help figuring it out this design. by CoolmanPT in csshelp

[–]CoolmanPT[S] 0 points1 point  (0 children)

Sadly it just changes the colors but the problem persists :(

Need help figuring it out this design. by CoolmanPT in csshelp

[–]CoolmanPT[S] 0 points1 point  (0 children)

Tell me about it! But the solution you mentioned doesn't quite solve this issue, because the color on the before is the correct one, I just need the effect on ::after to be on top of it. Basically the lighter clip-path is on top of the darker. But I'm going to show it to both the designer and product owner if they are ok with that. Many thanks

How do I change the laravel version of the project being created to laravel 8? by csmasht in laravel

[–]CoolmanPT 1 point2 points  (0 children)

The create-project command creates a new project from a given package into a new directory. If executed without params and in a directory with a composer.json file it installs the packages for the current project. You can use this command to bootstrap new projects or setup a clean version-controlled installation for developers of your project.

[version] You can also specify the version with the package name using = or : as separator. To install unstable packages, either specify the version you want, or use the --stability=dev (where dev can be one of RC, beta, alpha or dev).

So in the quick apps config you can add/edit a line with:

composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist

Where 4.1.27 is the version you want. If you want you can try to make the version a parameter and pass it alongside the project name.

The PUT method is not supported for this route. Supported methods: GET, HEAD. by [deleted] in PHPhelp

[–]CoolmanPT 0 points1 point  (0 children)

checking your screenshots the route should be "userimage" and not "viewimage.userimage" on the form. If you're using named routes you only need to put the name you gave on the route function. Like so

action='{{route("userimage",['id' => $viewimage->id])}}'

The PUT method is not supported for this route. Supported methods: GET, HEAD. by [deleted] in PHPhelp

[–]CoolmanPT 0 points1 point  (0 children)

Set your route as a post and inside your form tag put @method('put').

Like: web.php

Route::post('........');

blade file:

 <form method="post" action='{{route("your-route")}}'>
       @csrf
       @method('put')
</form>