Posts by Kayo Bruno • 2,777 points
137 posts
-
1
votes2
answers976
viewsA: Result field name instead of id on Laravel 5?
Try this: foreach ( Evento::with('tipo_evento')->get() as $evento ) { echo $evento->tipo_evento->nome; }
-
1
votes2
answers881
viewsA: LARAVEL Login by email or username
You can create a new login method as follows: public function authenticate( Request $request ) { $password = bcrypt( $request->input( 'password' ) ); $login = $request->input( 'login' ); //…
-
1
votes1
answer568
viewsA: Problem sending emails with Laravel 5.4
I found the problem, it was a block of my hosting, the digital Ocean by default blocks the sending of emails.
-
0
votes1
answer455
viewsA: Popular input type according to Selection made in Combobox(OPTION)
You can solve this with an ajax. In your user select you will use the "change" event to trigger the ajax. In the value of the options you must put the user ID to use it in ajax. // AJAX…
-
0
votes1
answer568
viewsQ: Problem sending emails with Laravel 5.4
I am trying to email the Laravel Mail class as follows. Code: Mail::send('companies.emails.register', ['company' => $company], function ($m) use ($company) { $m->to($company->email,…
-
0
votes2
answers651
viewsA: pass js value to another page in the action form
You cannot pass values from javascript to PHP unless you do this with Ajax. But we can do this in a simpler way. Create a field of type Hidden: <input type="hidden" name="variavel_js"…
-
2
votes3
answers902
viewsA: How to convert text field with mask to double
The problem occurs when you have a high value where "," and "." appear, for example: 5,150,50 You are just replacing the commas by a point, that is, after your replace the value is this way 5.150.50…
-
0
votes1
answer103
viewsA: How could I merge the ties below?
I’ll give you a suggestion, save this spreadsheet in CSV and use the following code. function loadFile ( $file ) { $data = []; if ( ( $handle = fopen( $file, "r" ) ) !== FALSE) { $i = 0; while ( (…
-
2
votes3
answers87
viewsA: PHP - Loop accentuation problem in a string
Try to do so: $letras = utf8_decode('nós'); $numero = strlen($letras); for($j = 0; $j < $numero; $j++){ echo utf8_encode($letras[$j])."-"; }
-
3
votes1
answer177
viewsA: Like "Zipar" files or directories in codeigniter
I’ll try to explain what’s in the documentation: 1 - You must load lib zip in your controller. $this->load->library('zip'); 2 - You declare the values you will use $filepath = 'mydata1.txt';…
-
1
votes2
answers1382
viewsQ: Options to generate API documentation in Laravel
I need a lib to generate API documentation in Laravel 5.4?
-
0
votes2
answers117
viewsA: PHP - If (condition) in wordpress
Try to do so. <div class="service-content <?php echo get_the_title() != 'Noivas' ? 'qwp-content' : '' ?>">
-
-2
votes4
answers100
viewsA: function_exists fatal error
The function "function_exists" should take the name of the function as string, in your example you are passing the function as parameter. if ( function_exists( 'nome_da_funcao' ) ) { call_user_func(…
-
1
votes2
answers923
viewsA: Pass jQuery variable inside Ajax
You can pass as many parameters as you want on the date. $('#botao_').click(function () { $.ajax({ url: basePath + 'ajax/importar_lista', data: {form: form, id_cliente: id_cliente}, processData:…
jqueryanswered Kayo Bruno 2,777 -
3
votes2
answers674
viewsA: How to use "echo" in an Laravel view?
You can also do so: @section('mensagens') <div class="container"> <div class="row"> <div class="col-md-2"></div> @if (count($errors)) <div class="col-md-8 alert…
-
2
votes2
answers509
viewsA: Force Session not to exceed 30 minutes
You can use the session_set_cookie_params to "set" a life time for the session $time = strtotime('+30 minutes', 0); session_set_cookie_params($time); session_start();…
phpanswered Kayo Bruno 2,777 -
4
votes3
answers1181
viewsA: How to check if type="file" field has been filled
Try to do so: if (!isset($_FILE['fileToUpload'])) { $msg = "Por favor coloque uma imagem!."; }
phpanswered Kayo Bruno 2,777 -
-2
votes2
answers240
viewsA: Association of categories in PHP and MYSQL
You should do a 1-to-N relationship, you should use this when a table needs to relate to multiple records from another table. You will have the item table and the category table and one more table…
mysqlanswered Kayo Bruno 2,777 -
2
votes1
answer611
viewsA: How to send via ajax the value of the selected option in a select?
Try this: $.ajax({ type: "POST", url: "scripts/retornaMunicipio.php", data: {uf: uf}, success:function(data){ data = $.parseJSON(data); $.each(data.retorno, function (i) { // código }); },…
-
4
votes1
answer3139
viewsA: utf8 fix text as remove strange characters
Put the code below inside your tag <head></head>. <meta charset="utf-8">
-
0
votes1
answer125
viewsA: Show slide only after loading
Run your slide only when the page finishes loading. jQuery(document).ready(function($){ $('.bxslider').bxSlider(); });
-
0
votes1
answer384
viewsA: Phpmyadmin Import file size
I suggest you do the import from the database, accessing mysql by command prompt, is much faster and you will not have problems with the size of your file and will not need to change your PHP…
-
3
votes2
answers344
viewsA: Php does not assign value in $_SESSION
Before you assign this: $_SESSION["success"] = "Produto removido com sucesso"; Put a session_start() and when to print as well, because you have to use the session_start() on all pages where you…
phpanswered Kayo Bruno 2,777 -
3
votes2
answers1431
viewsA: URL in netbeans does not work
Right click on your project, go to properties, then run configuration. Just change the project URL.
-
1
votes1
answer440
viewsA: Print an array with multiple select data, once
What it prints is the information of the $Records array, what can be happening is that the $horarios array is larger than the $Records array and the same is inside the $horarios foreach. For…
-
0
votes2
answers446
viewsA: onClick does not work on ipad
Try using the tap event instead of the click. $('.button_add').bind('tap',function() { alert('Deu certo!'); });
-
3
votes2
answers44
viewsA: Insert minute by minute into function
Make an "if" within minutes "for". if ($min < 10) { $min_correto = '0' . $min } else { $min_correto = $min; } ai you put the $min_correct variable to be displayed instead of $min…
phpanswered Kayo Bruno 2,777 -
2
votes3
answers433
viewsA: Sending external PHP variable to Javascript
I think you don’t need to use javascript or jquery, as you don’t want to use Ajax you can only use PHP itself. Create a "helper" file that will contain auxiliary functions and do the following…
-
3
votes2
answers1353
viewsA: What can the Model do to validate the MVC?
In the MVC model you must make the validations of business rules within the Model, thus leaving the controller responsible only for the flow, ie principle of sole responsibility. Model should drive…
-
0
votes2
answers678
viewsA: I cannot bring the database data from more than one table
Your "tb_projects" table does not have the "name" field, remove "ORDER BY name".
-
0
votes3
answers296
viewsA: Javascript and SQL - Fill out a boleto with data from a row after selecting it
You can do it the following way: take the id of this query and pass as parameter of its function verBoleto(); onclick="verBoleto("+ data[i]['id'] +");" Ai in its function "verBoleto()" you make a…
-
0
votes2
answers117
viewsA: Save Features in BD
Friend what you will have there is a relationship for many, I mean, N for N. What you should do is: create a table called "vehicle", another called "characteristic" and another called "vehicle" that…
-
2
votes1
answer121
viewsA: Gallery with PHP and Javascript not working correctly
Checks whether this array ($galeria_1) really has all positions, because it looks like it only has one position.
-
1
votes2
answers213
viewsA: How can I get the text inside a combobox?
Use jQuery and send your data to the database with Ajax: $('select[name="combobox"]').change(function(){ var text = $('select[name="combobox"] option:selected').text(); $.ajax({ url:…
-
2
votes3
answers944
viewsA: Calculus in Javascript
You must replace "," with "." or convert the values to float: var valorConvertido = parseFloat($("#precoVendaNoMercado").val());
jqueryanswered Kayo Bruno 2,777 -
1
votes3
answers234
viewsA: Error in Jquery pro PHP parameter crossing
The problem is that you are passing an empty variable. data: {idCategoria: id } // Esse id ta vindo de onde??? Ele não foi declarado The correct is to take the value of this ID of some input or…
-
1
votes3
answers5398
viewsA: How do I load one controller into another?
Good friend if I understand right, this is simple to do. I imagined the following situation: you have the controller Desenvolvedor.php which is in controllers/Desenvolvedor/Desenvolvedor.php ai you…