Posts by Vinicius Lourenço • 756 points
41 posts
-
0
votes1
answer616
viewsA: Navcontroller push error
You are using version 4 of Ionic which no longer has the method push. To navigate between pages, you need to use the new method called navigateForward. Its use would be like this: // O…
ionicanswered Vinicius Lourenço 756 -
0
votes1
answer459
viewsA: Ctrl + c button in typescript, Ionic
A desktop solution would be like this: import { Directive, Input, Output, EventEmitter, HostListener } from "@angular/core"; @Directive({ selector: '[copy-clipboard]' }) export class…
-
0
votes1
answer151
viewsA: Upper and Lower case function
You want to send the texts in upper case and minuscule but are not transforming these texts, for this, use the native functions of Javascript to manipulate texts, thus: upper(){…
-
0
votes1
answer243
viewsA: ALERT with input text and checkbox - IONIC 3
In the official documentation found at that link says the following: (...) Radios, checkboxes and text inputs are all accepted, but they cannot be Mixed. For example, an Alert could have all radio…
-
0
votes1
answer98
viewsA: Ionic 4 Query
Your *ngFor is set to repeat items from the named list contact, then, when executing the method find you need to filter the way you want and then set this value in the variable contact. Getting…
ionicanswered Vinicius Lourenço 756 -
0
votes1
answer85
viewsA: Ionic 4 navigate
Are you wearing a Behaviour Subject or Subject instead of a Observable ? Because thus, your intention is to update the information and send this update to all functions that are registered to…
ionicanswered Vinicius Lourenço 756 -
0
votes1
answer93
viewsA: Treat return of the maps api getdetails() function in angular/Ionic
The variable this.detalhes nor initialized and so gives error when trying to assign some value. Initialize the variable like this: detalhes: Array<any> = []; Or detalhes: any[] = []; Also, you…
-
1
votes2
answers2327
viewsA: In Ionic, the President is now Service?
In practice, both have the same functionality but in Ionic 4 it adopts the nomenclature of Service, while in Ionic 3, it is called Provider. Of differences, in Ionic 3, the generated file is…
ionicanswered Vinicius Lourenço 756 -
1
votes1
answer531
viewsA: Store Laravel 5.7 date fields?
The table field you want to save to is in format DateTime, naturally it needs the time. To store only dates, use $this->date('campo') in creating the table.
-
0
votes1
answer76
viewsA: Switching components at runtime in Ionic 3
As mentioned by @Leonardolima, you can use the AlertController provided by Ionic itself using the enableBackdropDismiss as false. How much you display the form by clicking on Sim, you can use the…
-
0
votes1
answer111
viewsA: Error starting an Ionic project
Your problem is with installing NPM, which has either not been installed, or has been installed incorrectly. If you installed, don’t forget to restart your computer after installation. If this does…
-
2
votes1
answer3271
viewsA: How to put a background image in my ion-content
By code, I assume the version you’re using is Ionic 4. Therefore, to change the background of ion-content, you use: ion-content { --background: #ffff00 url('../../assets/imagem.png') no-repeat…
-
0
votes3
answers6310
viewsA: Problem with brmask in Ionic 4?
I had the same problem, and my solution was to use another plugin called ngx-Mask. But I couldn’t use the [(ngModel)]. To solve how to update the values in a variable, in the button I added…
-
2
votes1
answer36
viewsA: Simple question about Laravel and get() function
When you use the get, he executes the query which is stored in the Builder and it returns the values of this query. When you don’t use the get, you just return an instance of Builder and with that,…
laravelanswered Vinicius Lourenço 756 -
3
votes1
answer1557
viewsA: Undefined offset 0 - Laravel
Sometimes a user may not have a role defined, and even though by the question I understand that every user has a role, sometimes, it may be the case that it was registered without a role. I would…
-
1
votes1
answer340
viewsA: Problem with PUT Laravel
When you use Route::resource('automoveis') to generate its routes, it generates the following routes: Método Caminho Ação Route Name GET /automoveis index automoveis.index GET /automoveis/create…
-
1
votes2
answers44
viewsA: Error using Many to Many
You want to upload users and also people’s information, if so, use: Usuarios::where('usuario_id', $usuario_id)->with('Pessoas')->toSql(); For you to use the function Pessoas you need to call…
-
1
votes1
answer199
viewsA: Laravel Relationship on Datatable server side
From what I understand, you want to pass the values of marca of each AutomovelModelo to the Datatable, only that you are not loading this information. For this, use the function with to carry the…
-
2
votes2
answers164
viewsA: How to filter Combobox data using Laravel Framework?
In addition to what @Weslei replied, as you want to ignore a list of items, you can combine the function pluck and whereNotIn, thus: ChecklistModelo::whereNotIn('id',…
-
1
votes1
answer2182
viewsA: Call to Undefined method Illuminate Database Query Builder::table()
Instead of Avaliativo_Relatorio, use: $avaliativo = \DB::table('mdl_role_assignments')...->get(); Or you can add the property $table the class Avaliativo_Relatorio, thus: protected $table =…
-
0
votes2
answers57
viewsA: if with array listing
The variables within your while are not stated out of scope of while, soon, when you make the comparisons they are initialized and have value null. Even if you declare them out, you’re passing…
-
0
votes1
answer26
viewsA: Does anyone know of a function that passes the array positions?
A solution to rearrange the position of an array’s values in this way is to combine array_shift and array_push as follows: $numeros = array(1, 2, 3); $primeiro = array_shift($numeros); // Pega o…
-
0
votes2
answers208
viewsA: Quote problem in query syntax in Mysql
If you take the simple quotes from SET $detail = '$value' WHERE... and $value is null or empty, it causes this error because SQL will be mounted like this SET $detail = WHERE.... The simplest way to…
-
0
votes1
answer114
viewsA: Practical Example of Working with Eloquent in Laravel 5.6 (Relationships)
For inverse one-to-many relations, you use the relationship function belongsTo, this way in class Funcionario: public function cargo() { return…
-
2
votes2
answers74
viewsA: Methods with multiple PHP parameters
Create a class with all properties class FichaMedica { public $idFuncionario; ... I would also recommend using the properties by $classe->propriedade instead of creating a function setPropriedade…
phpanswered Vinicius Lourenço 756 -
1
votes2
answers461
viewsA: Generating PDF with Laravel
To implement, as you are using a framework, I would suggest installing through Composer. First, add to composer.json the dependency of TCPDF: "require": { // Aqui terá todas as dependencias do…
-
0
votes1
answer691
viewsA: "Undefined Property: stdClass::$email" Laravel
The correct way to check if there was an error in the e-mail validation is to use the function has: if ($errors->has('email')) { // Código de tratamento } You don’t need to use json_decode…
-
0
votes1
answer1863
viewsA: Undefined index Laravel
Ps: in this answer I assume you are overwriting the RegisterController. Your code is correct only that Laravel is not passing the usuario_anjo because it is not in the validation, and the…
-
1
votes1
answer26
viewsA: Best method for categories via php and mysql
Use relationships between tables to your advantage to solve this problem. Create a table for skills: CREATE TABLE habilidades ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, nome VARCHAR(256) NOT…
-
1
votes1
answer35
viewsA: Doubt with route
I’ll give you two choices, whichever is convenient. First option Instead of passing the value on the route like this {id}, you can use the query strings. Then on your route, you would track the {id}…
-
1
votes1
answer1504
viewsA: Error Handling Problems - PHP Laravel
I believe it’s not returning the way you want it to because this code is importing the Exception wrongly: } catch (Exception $e) { It should be like this: } catch (\Exception $e) { Before, the…
-
0
votes1
answer1112
viewsA: Popular Select with Laravel 5.6 database records
When you want to return all results even those that are already deleted, you use: \App\Funcionario::withTrashed()->get(); This can be put into relationships too, so: return…
-
1
votes1
answer31
viewsA: Help with middleware group
When you use the Laravel Standard Middleware it sets some name of standard routes. In your case, you have secured the route localhost/ but did not define the name as login on some other route so…
laravelanswered Vinicius Lourenço 756 -
2
votes1
answer318
viewsA: Is there any way to generate Migrations based on an existing database in Laravel?
There is a library called Migrations Generator which reads an existing database and generates the migrations correspondents and she even supports the Laravel 4. I did a simple test using Laravel…
-
1
votes1
answer317
viewsA: Error logging in to Laravel
You’re not calling the action correct, substitute: Route::post('/logar', 'AutenticacaoController@login')->name('autenticacao.logar'); For: Route::post('/logar',…
laravelanswered Vinicius Lourenço 756 -
1
votes1
answer733
viewsA: Chat with warning notification in Lockable
In your Migration "messages", add: $table->timestamp('read_at')->nullable(); With this field, you can know the messages that have already been read and the messages that have not been read.…
-
1
votes1
answer275
viewsA: How to create Laravel search by taking data from the cache?
Doing a little research I found a solution that might suit you. Instead of searching your cache, you can store the search using your url as a key the first time you ask for it, and the second time…
-
6
votes3
answers1335
viewsA: What is the advantage of dependency injection in relation to an object instance?
An example of code using an object instance. public interface DebugInterface { void error(string message); } public class Debug implements DebugInterface { public void error(string message) { //…
-
1
votes1
answer174
viewsA: Compare two tables in mysql by grouping the main table and listing the result of the second table
This answer is not a solution in Mysql but I believe it solves your problem. In Laravel’s documentation there is a feature called Eager Loading, with it you can fetch values from a table taking also…
-
0
votes1
answer483
viewsA: When and where to handle exceptions with Laravel in developing an API
When I create an API, I always treat the exceptions that my application throws because its format is usually released in HTML, and since it is an API, I want it to be released in JSON format. I…
-
0
votes1
answer171
viewsA: Problems with php Artisan command using Laradock
In order to be able to create files without having to exchange the permission every time, log in to Workspace using the command: docker-compose exec --user=laradock workspace bash…