Posts by Hegon Felipe • 155 points
14 posts
-
0
votes1
answer88
viewsA: Return of attributes in Model Laravel
The problem was solved only by adding the Hidden variable to the Model: protected $hidden = ['categoria'];
-
-2
votes1
answer88
viewsQ: Return of attributes in Model Laravel
I have an application where subcategories are associated with a category. In the Subcategory Model the relationship between both is performed and the category name is returned through getattribute,…
-
2
votes3
answers144
viewsA: HTML Doubt Send text from an inputtext to php
You are sending the 'numerotelefone' via the Hidden input with the nume default value, via value=nume. If you want to enter the phone number, use this code: <html> <head> <title>..…
-
1
votes1
answer31
viewsA: back version of woocomerc plugin 3.7.0 for 3.6.5
The Wordpress information is not stored in the plugin but in the database, so if you perform the rollback of your plugin will not lose data. There is a plugin that does this, the WP Rollback, that…
-
1
votes1
answer224
viewsA: How to prevent a user from accessing another user’s ID when editing a post by making improper changes?
Laravel has Authentication features. For this you need to run the following Artisan command: php artisan make:policie UserPolicy After that you will need to define what the rules will be using the…
-
1
votes2
answers100
viewsA: What kind of problems do routes solve?
SOLID is the principles of object programming and helps us write better code. The first is the Single Responsibility Principle (SRP) or Single Responsibility Principle. This principle states that…
-
0
votes1
answer426
viewsA: How to create a product via SQL in Woocommerce
Wordpress is a CMS platform created initially for use in blogs. With the support of plugins, it was possible to add features such as Woocommerce. The fields initially provided in the table wp_posts…
-
0
votes2
answers78
viewsQ: Factory of Relation N:N
I am with an application where users can see or not certain system module according to their permissions. These permissions are saved to the database in a way N:N and managed in UserPolicy, as an…
-
0
votes1
answer441
viewsQ: User mock for testing in Laravel/Phpunit
I have a legacy application in Laravel where users can see or not certain system module according to their permissions. These permissions are saved to the database in N:N form and managed in…
-
1
votes2
answers88
viewsA: How to recover calculated fields in Laravel?
At first, what you need to do is retrieve the specific field of your model: $tipos = TituloTipo::all(); $devedores = Devedor::all(); $clientes = Cliente::all(); $divida = Divida::find($id);…
-
1
votes1
answer124
viewsA: Possible redirect function without route on Laravel?
What can be done is you create a Helpers folder in your app, create a file with its function and load it through the Composer, inserting in Composer.json, in "autoload" (as an example): "autoload":…
-
0
votes1
answer319
viewsA: Query for searching with multiple tables
Before implementing in Laravel you need to understand a little more about database relationships. In the relation Defendant-Process and Plaintiff-Process you have relationship N:N, therefore it…
-
0
votes1
answer184
viewsA: Foreign key creation error Mariadb
As good practice, it is always important to mark as UNSIGNED the ID columns, avoiding problems related to negative numbers. Try the following creation query: CREATE TABLE `compras` ( `id` int…
-
1
votes0
answers361
viewsQ: How to install Composer on Windows 10?
I am trying to install Composer on Windows 10, but the following error message is appearing: The PHP exe file you specified Did not run correctly: C: Program Files Vertrigoserv Php php.exe The…