Posts by Lucas Pace • 409 points
19 posts
-
3
votes1
answer58
viewsA: Returning Multiple Values
Briefly, it is printing Não Encontrado!! :( several times why the condition is inside a repeat loop. First of all: arrays in C begin in zero. What does that mean? Your matrix has 5 x 5 positions and…
-
-1
votes1
answer46
viewsA: filter cities by state in Laravel with Javascript?
One solution I see is to make a POST request with Ajax, something like that: $.ajax({ "url": "{{ route('citiesByState') }}", type: "POST", data: { id_selected_state: id_selected_state }, headers: {…
-
1
votes1
answer20
viewsA: I’m having trouble leaving a blue button on the side
@foreach ($likes as $like) @if($like->id_post === $post->id && $like->id_user === auth()->user()->id) //Se o post tiver like @break // Break no…
-
0
votes1
answer172
viewsA: Variable JS inside html tag inside Laravel Blade
One solution I found is to define the action value according to which the select is changed, thus: function option(valor) { $('#pform').attr('action', '/registrar/' + valor); } Also, you should…
-
0
votes1
answer68
viewsA: Laravel 7, how to call iterate an input that has no right name
Hi, how are you? Instead of using 'data_type' + id in the input name, we can use an array. <input name="data_type[]"> This way, the request->data_type will arrive in the controller as a…
-
0
votes1
answer97
viewsA: The following Parameters must be Valid date and format (yyyy-MM-dd’T'HH:mm:ssz): date_of_expiration
From what I’ve seen, you’re missing the’T' in your code. Also, by documentation of pagseguro they use the fraction of seconds with 3 houses, for that you must use 'v' in the format and for the time…
-
1
votes1
answer25
viewsA: How does a button redirect to a page after having the email and password confirmed?
Simulating a mouse click: window.location.href = "http://www.google.com"; Simulating an HTTP redirect: window.location.replace("http://www.google.com"); In your case, it would be something like…
javascriptanswered Lucas Pace 409 -
2
votes1
answer63
viewsA: How to use Custom Request in Controller
The question is not very clear, otherwise what you’re looking for edits the question, okay? From what I understand you want to validate the user by following the rules of AuthRegisterRequest.php. So…
laravelanswered Lucas Pace 409 -
2
votes1
answer103
viewsA: Customization of Laravel Validator message
As commented by Thiago, the ideal would be for you to create a Rule as follows: Running the command to create the validation file in app/rules php artisan make:rule CpfValidation In the passes…
laravelanswered Lucas Pace 409 -
1
votes2
answers68
viewsA: Sending email in HTML format via an Ajax JS request to an API that uses Curl in PHP
That reply should be a comment but I have no reputation for it. Can’t you access the variables sent by ajax? Something like this $email = $_POST['dados']['personalizations']['to']['email];…
-
0
votes3
answers611
viewsA: Code does not run in C on Vscode
The ./ works only on linux operating systems. It indicates that we are running the program in the current folder. However, in windows, just run teste.exe being in the application folder.…
-
4
votes1
answer96
viewsA: Is it correct to read the Migrations files and the configuration file?
Right in the introduction of the Phinx, we face the following reflection: Good Developers Always version their code using a SCM system, so Why don’t they do the same for their database schema?…
-
0
votes1
answer179
viewsA: problem with Routes Laravel 7.0 shared hosting
You should point to the root folder of the project being the /public. There must be some option within Cpanel to define which root folder. If not, you can move the files from the folder public to…
-
0
votes3
answers61
viewsA: When creating a new user, the user being used is logged in and the new user is logged in automatically
Ideally you would post more about the User, as Middleware, own Model, among other things that interact with the User and that may be affecting. For a palliative solution I suggest using the function…
-
1
votes1
answer100
viewsA: Consultations nestled in Laravel
As I understand it, a product belongs to a subcategory, right? So a subcategory has several products, namely a relation One to Many. This way, you can access the products that belong to your…
-
1
votes1
answer42
viewsA: Foreach - Conditions within a period
Yes, the foreach is just a repeat loop, meaning we will repeat a block of instructions any. In this case, for each $periodo element there will be a loop of repetition. An example of a condition…
-
0
votes2
answers134
viewsA: How to return erased information with softdelete within a relation
The problem was solved including ->withTrashed in relation. In the Pagamento.php: public function user() { return $this->belongsTo('App\User')->withTrashed(); }…
-
0
votes2
answers134
viewsQ: How to return erased information with softdelete within a relation
There is a model in my application called payment that belongs to a user. I pull the information with Pagamento::latest()->with('user'); That way if a user is deleted, even if he already has soft…
-
0
votes0
answers85
viewsQ: Memory junk when pointing a pointer
In an attempt to implement an adjacent matrix graph, I created the function to create a new "matrix" in which the contents of the graph would be copied to it by adding the new positions. However,…