Posts by Ademir Mazer Jr - Nuno • 2,258 points
84 posts
-
0
votes4
answers1271
viewsA: Error in setting Route Orange 8?
There are 3 ways to do this, as Laravel 8 has changed the namespace setting: Adding $namespace again to the configuration so you can continue using the routes as you did in Laravel 7.x and earlier…
-
1
votes2
answers28
viewsA: Updating payment status using Cron in the Standard
The way is to implement an Artisan command in your application that when executed expires payments, say its name is expirar-pagamentos Then you create a Schedule entry in the file…
-
1
votes1
answer23
viewsA: how to define the last translation used by the user on the platform
Saves a cache with the user’s login when he changes the language, for example Cache::put(auth()->user()->username.'_lang', $linguaEscolhida); Then it implements a middleware that defines the…
laravelanswered Ademir Mazer Jr - Nuno 2,258 -
0
votes2
answers30
viewsA: Get default response if it does not exist in Laravel’s Wherein
I would use another logic, map the items and return with the collection structure you need $itemsAvaiable = Item::whereIn('item_id', $item_ids)->get(['item_id', 'is_available']);…
-
1
votes1
answer18
viewsA: Create eloquent Query in Readable to query that take the longest date of the column and show a vehicle of each
Assuming the eloquent model name is Sale, you need to sort by the datetime_write field in descending order and group by vehicle_id Venda::ordeyBy('datetime_write',…
-
2
votes3
answers103
viewsA: Am I doing polymorphism the right way?
It is not a bad practice no, as long as it is well structured as to the context and responsibility. This means, do not add methods in the superclass to force behavior in subclasses that is unnatural…
-
1
votes1
answer206
viewsA: Laravel : Add fields in two tables (Related Tables)
Change the test if a doc already exists to before starting the logic of creating a new case does not exist public function insert2(Request $request){ $doc = documentacao::where('nome_ficheiro', '=',…
-
0
votes1
answer190
viewsA: Create branch from another branch
I think what you want is to work with Feature branch - that’s a workflow concept in Git. Basically, from the "root" branch of its development, in this case the develop2.0, you create branches for…
gitanswered Ademir Mazer Jr - Nuno 2,258 -
1
votes1
answer34
viewsA: How to display data correctly in a datatable
You need to add Relationship methods to the models and navigate correctly on the Blade. An example for the Chapter model: <?php // imports class Capitulo extends Model // configuração do modelo…
-
5
votes2
answers51
viewsA: Are Mongodb’s "id" unique among collections?
According to official documentation, Objectids are small, "probably" unique, fast-generation and ordered values. This "probably" documentation would be more related to the impossibility of ensuring…
-
0
votes1
answer21
viewsA: Make a relationship with data already created
In the class controller, on this line: $class->professor()->professor = $request->input('professor'); You are trying to add an entire value to a field that does not exist in Professor, when…
-
1
votes1
answer104
viewsA: How to reopen a closed pull request on Github?
Go to the bottom of the Pull Request page, just below the text box, have the button Reopen pull request…
githubanswered Ademir Mazer Jr - Nuno 2,258 -
1
votes1
answer82
viewsA: Doubt about changing data in PHP MVC
For what you put in the comment only one of the actions is executed, you are waiting for both routes to be executed but - thinking of the routing implementation patterns, only one is because when…
-
-1
votes1
answer45
viewsA: I was able to search 1 more query in the database with PHP
You are testing if there is a post parameter for name, if it exists, it only mounts the query for this field. If it does not exist you assemble what seems to me a copmplet return to all paginated…
-
0
votes2
answers496
viewsA: Cannot read Property 'addeventlistener' of null Console error
Probably the error is happening on this line btnLigamos.addEventListener('click', function () ... correct? Do the test as you did in the previous part of the code, if the result of the…
javascriptanswered Ademir Mazer Jr - Nuno 2,258 -
2
votes2
answers176
viewsA: Is Scrum an incomplete methodology? Or: Does Agile Need UML?
Scrum is not a methodology for software development but a framework that was born with the intention of being applied in product development project management. According to Scrum.org (free…
-
0
votes1
answer24
viewsA: Unable to load plugin watch (Less)
You are not trying to install but run Less with the lessc command. Use Node Version Manager (nvm) to install and use the latest version of Node.js - case do not have Ode installed on your Windows,…
-
-1
votes1
answer144
viewsA: Update quantity with update (Shopping Cart)
You are not identifying the products that should have changed quantities when the button is pressed. A suggested solution would be to change the components to the plus and Minus buttons using a link…
phpanswered Ademir Mazer Jr - Nuno 2,258 -
0
votes1
answer30
viewsA: Pull only user items
You must use the clause WHERE in your event query query to filter by authenticated user. Assuming your user is on $_SESSION in the user index, and the value stored in this variable is only your id,…
-
1
votes1
answer61
viewsA: I created a form inside my site to be sent to my email, it’s not coming in the inbox. What can it be?
The mistake is in the if, see that no information is returned, Sponse is empty, indicating that it does not enter this IF. It turns out you misnamed the array $_POST, you typed $POST['email']…
-
1
votes1
answer156
viewsA: Sql Father and Children in the Same Table
From what I understand you need the search to return the whole tree, even if the criterion is the final item, as in the 3017 example. The problem is that your code only advances to the destinations…
-
0
votes1
answer103
viewsA: I can’t display DB data in front-End
Its function recuperar should return the values consulted, for example: public function recuperar() { $sql = $this->db->prepare('SELECT nome, link FROM links'); $sql->execute();…
-
0
votes1
answer538
viewsA: What does the Storage folder in the Laravel do?
Replies to @Felipe-moereira and @Tiago-luz are incomplete. Yes the Storage post allows the management of uploads and file manipulation, this in the subfolder app, but in its structure you find other…
-
1
votes2
answers523
viewsA: A phone chart for each customer or just one for all customers?
The scenario you are setting should be considered in relation to the DBMS (Database Manager System) which will use, more specifically, the DBMS model. I will consider two models: Relational (as…
-
0
votes1
answer88
viewsA: Help to transform a for each ( from a php file_get_contents ) into Json Encode
In the example below I am using Domxpath to navigate, assuming, from what I saw of the HTML content, that only one table exists on this page. You need to improve according to details of your need,…
-
0
votes1
answer118
viewsA: Extract data from an HTML form with PHP and write Json
I believe a better solution is to parse html with Domdocument and Domxpath. Domdocument allows us to generate a manipulable object from a DOM document, in this case HTML, could be an XML as well.…
-
2
votes2
answers329
viewsA: Laravel architecture for Saas systems
This system of yours seems to be a Saas (Software as a Service), which is a form of software distribution where systems are accessible from multiple devices through a client interface on a…
-
1
votes4
answers68
viewsA: Doubt about Group by
You need to define the grouping expression in the SELECT clause. It is necessary to use one of them: SUM, AVERAGE, COUNT, etc ... in this context the SUM It is important to be aware that, to use in…
-
0
votes1
answer100
viewsA: Multiple App Laravel using the same App table
As long as the balance is adequate, I see no problems. I believe you should do a comparative analysis: If I run a single application on a single queue server, and this application/server supports,…
-
-1
votes1
answer98
viewsA: How to make Bootstrap Dynamic Tabs with Portable?
What I will describe below does not answer your question initially, but I demonstrate an architecture problem in your code. As for the error properties, you are probably using the names of the wrong…
-
-1
votes1
answer42
viewsA: How to structure a PHP project for multi ecommerces working with the same crm
According to your answer to my question, I will then answer the specific question the best option would be to display the images pointing to H1 or manually upload each product in dirty respective…
-
1
votes2
answers66
viewsA: How to search for all associations in a relationship tree in Laravel?
The problem is that you are trying to access multiple levels of relationship using hasManyThrough, which actually only manages to relate through "trough" a single sublevel. See which error p is…
-
0
votes1
answer397
viewsA: Convert sql to query Builder - Laravel
You can use selectRaw instead of select, and add the groupBy clause with eloquent methods. I believe that one of the return errors you are receiving is from the database itself, indicating that the…
-
0
votes1
answer164
viewsA: Is it correct to use get/set and other methods in the model of the Laravel?
is not incorrect, but there are ways that the eloquent itself delivers: your first example getPoduto should have a better context of name maybe (I’m imagining you’re using the "Product" model) ...…
-
0
votes2
answers462
viewsA: Laravel multitenancy with a user-only BD
I have two Saas systems developed in Laravel, and use a single database. For the separation of data by company, all tables have the foreign key referencing the contractor table. To help the code,…
-
2
votes1
answer358
viewsA: How to customize authentication fields in Laravel 6
Change your user model by overriding the method that returns the name of the password field: public function getAuthPassword(){ return $this->senha; } In the form keep the input name as…
-
0
votes1
answer39
viewsA: Create foreach with another foreach result
In its logic the problem is to pass the entire collection of disciplines without distinguishing what the relationship with each module. Anyway, this is not the best way to work with Laravel and…
-
0
votes2
answers976
viewsA: How to get javascript/jquery ajax array values
The return shown in Alert indicates that it is an array and not an object. This way, you must access using the index name: var x = data['nome'];
-
1
votes1
answer101
viewsA: What is the relationship between the application layer and the controller class?
(How many controllers!) Yes, the nomenclature and the "function" are similar for the various controllers, but the context differs. There is user interface controller and domain controller as most…
-
1
votes1
answer1108
viewsA: Compress image when uploading with Expandable
I suggest using the package Intervention Image, that has integration with Laravel A simple example that upload changes the image and saves it to disk: <?php ... class MyController extends…
-
2
votes1
answer178
viewsA: How to add password exchange notification in Laravel?
You do not need to overwrite the method for this as the framework itself triggers the event on the line event(new PasswordReset($user));. So what you need to do is create a Listener for the event…
-
0
votes1
answer129
viewsA: Organizing Laravel Migrations into a subfolder is bad practice?
I believe it is not necessary, the effort does not compensate for the return in this organization, unlike controllers, models and visions, which are groups of code logic to which you return…
-
1
votes1
answer1490
viewsA: symbolic link with Storage Laravel 5.2 folder
You can do directly per command line. Linux: ls -l -s meuprojeto/storage/app meuprojeto/public Windows mklink /D "meuprojeto/storage/app" "meuprojeto/public" References What is the difference…
-
0
votes2
answers1804
viewsA: Dompdf API for PDF generation in PHP
You can use a PDF Viewer in Javascript to receive streaming, I suggest the Mozilla PDF.js: https://mozilla.github.io/pdf.js/…
-
0
votes1
answer551
viewsA: How to recover image from Storage folder using INTERVENTION IMAGE Laravel 5.2?
You will need to create a specific route and controller action to load the images, as the Storage folder is not, or should not be, accessed directly by the browser calls. For example: Route…
-
2
votes1
answer56
viewsA: How to install only autoload and Laravel routes in a new project?
Use the microframework developed from Laravel, and maintained by the same team: Lumen - https://lumen.laravel.com/
-
3
votes2
answers547
viewsA: Search ID in a PHP select
<select class="form-control" name="cliente"> .... </select> These lines are the opening and closing of the HTML tag to create a selection object (combo box or select) on the HTML page,…
-
0
votes1
answer108
viewsA: Get description of sub-category PHP Laravel Eloquent
You need to add a Join to the category self relationship: public static function getMovimentos() { return DB::table('movimentos') ->join('produtos', 'produtos.id', '=', 'movimentos.id_produto')…
-
2
votes1
answer2025
viewsA: Pick up records with date greater than the current - Laravel 5.1
First ensure that your dates are handled correctly in the global format that uses Carbon: https://laravel.com/docs/5.4/eloquent-mutators#date-mutators ... class SeuModelo { protected $dates = […
-
1
votes1
answer1146
viewsA: Maximum Function nesting level of '100'
It is recommended if you cannot change the logic of the function so that it decreases the number of recursions. However, this solution also relies on performance impact analysis and memory…