Posts by novic • 35,673 points
1,265 posts
-
1
votes1
answer38
viewsA: Help for this query
In the SQL of the question, change LEFT JOIN for RIGHT JOIN select u.id_usuario, u.nome_usuario, count(l.id_log) as qtde from logs as l right join usuario as u on l.usuario_log = u.id_usuario group…
-
2
votes1
answer887
viewsA: Laravel Update With Relationships - Good Practice
Would use the same instance, $produto->Product_info() if there is, if not, I would create what you are doing. $product = Product::find($id); $product->display_name =…
-
2
votes2
answers5346
viewsA: Automappermappingexception: Missing type map Configuration or Unsupported Mapping
Ricardo I ended up doing a test and found that in DominioProfile have to call CreateMap thus: public class DominioProfile : Profile { [Obsolete] protected override void Configure() {…
-
1
votes2
answers706
viewsA: Validation in Laravel 5 in array fields?
Your FormRequest need to know that the name field is a array and the Larable already has a form of validate the field only needs to have the following nomenclature: nome_do_campo + .* As their…
-
3
votes2
answers2096
views -
1
votes1
answer304
viewsA: Object List(with some objects as attributes) for Datagridview - C#
Use the Linq to format the data, the DataGridView does not accept grouped objects, or list of a main object, and even rewriting ToString(), that I see as wrong technique, could not bring the two…
-
1
votes2
answers2085
viewsA: Radio button selection return in C#
In your code, you failed to check whether the Control is of a certain type, is falling in value -1 each time because of different elements of the RadioButton who does not own the property Checked,…
-
2
votes1
answer495
viewsA: Auth always returning false
No need to change the code that comes with the Larable, because, it has several ways of implementing login of user, go back to before and follow this logic. First thing into the briefcase config…
-
1
votes1
answer170
viewsA: Access in the view the last values entered in the database
At last one was missing get(); to return the data from this collection (Collections). The error is that it is being sent to view an object Builder (object(Illuminate\Database\Eloquent\Builder)).…
-
5
votes5
answers4473
viewsA: In the ORDER BY of a SELECT change a comma for a period
In your specific case the transition to the type should be made decimal(18,2), but, there is an option that may cause a bit of slowness in the consultation, but, it works in a general way: SELECT *…
-
0
votes3
answers14457
views -
4
votes2
answers2511
viewsA: How to add item in array through a foreach?
Can use Linq, not specified in this specific case to use a repeating structure. DirectoryInfo di = new DirectoryInfo(_caminhoEmail); FileInfo[] rgFiles = di.GetFiles("*.ost"); return…
-
2
votes1
answer49
viewsA: How to enter several data received from the same field?
That one form will return something like this: Code: <?php var_dump($_POST['tags']); Exit: array(6) { [0]=> string(8) "sistema1" [1]=> string(8) "sistema2" [2]=> string(8) "sistema3"…
-
3
votes1
answer136
viewsA: Doubt about using checked="checked" in a jquery function
Use the $(document).ready(function() {}); that will define the actions when the page load is finished. $('#meuCheckbox').click(function() { $('#meuTexto').attr('disabled', !this.checked) });…
-
2
votes2
answers2387
viewsA: Do a custom validation on Laravel 5
A field that may or may not be mandatory that depends on another field (in your case is a checkbox), should use the required_if which follows the nomenclature: required_if:anotherfield,value…
-
2
votes1
answer165
viewsA: Problem with each jquery
A simple adjustment: In the $.each not only is data is data.produtos by way of sending, then, $.each(data.produtos ... Follows complete code: $.getJSON('http://localhost:8000/produtos',…
-
1
votes2
answers145
viewsA: Object property from JSON is not accessible
Missed carrying relationship, this is not automatic as it was done: With the command with of eloquent, relationships are born: public function index() { $produtos = Produto::with('imagens')…
-
0
votes3
answers533
viewsA: How to compare Mysql to an array?
Response taken from Soen if your code is with PDO $inteiros = array(1,2,3,4,5,6,7,8,9,10); $qMarks = str_repeat('?,', count($ids) - 1) . '?'; $sth = $db->prepare("SELECT * FROM myTable WHERE id…
-
0
votes2
answers1580
viewsA: Problems with charset in the Laravel
You can use the Accessors & Mutators of Larable, where field formatting is done directly model: I will propose an example, because in your question there is no model and it would be important to…
-
3
votes3
answers245
viewsA: Error doing Join with Laravel Query Builder
The Query Builder of Laravel 5.2 does not return a class Collection but, um array simple, look at the informative text in English: Like raw queries, the get method Returns an array of Results Where…
-
14
votes2
answers529
viewsQ: What is checked in the code in C#?
I saw a code: using (IEnumerator<TSource> e = source.GetEnumerator()) { checked { while (e.MoveNext()) count++; } } What is the purpose of the code checked {} in that code C#?…
-
3
votes1
answer142
viewsA: Is it possible to sort the result of the parent model by the child model?
Is there a way to sort with the collection result, that is to say, Collection class, with the command Sort Example: Code: $collect = collect(['d' => 2, 'a' => 1, 'z' => 0]); return…
-
2
votes1
answer756
viewsA: Error "1052 Column in Where clause is ambiguous"?
In the where include the table name (doador.id_doador) equal in this example: public function minhasDoacoes(){ $id_doador = $this->session->userdata('id_doador'); $this->db ->select('*')…
-
1
votes1
answer128
viewsA: How to indent a new file name in an automatic "Drag and Drop" upload
If you send multiple files or only one there is one array that informs the generated names that have the chave name: Specific location in the example code: if($data['isComplete']){ $files =…
-
4
votes1
answer1374
viewsA: Create Unique constraint with two fields in the Laravel request
Create a custom validation rule, because, your case is particular, I took a look at the current rules, I think none can do what you need, maybe in parts, so make your own rule by first creating a…
-
1
votes2
answers192
viewsA: Remove value "json header"
<?php $array = json_decode('{"37":{"codigo":"37","firstname":"Aluno","lastname":"Toledo","atividade":"A","checklist":null}, "1475":{"codigo":"1475","firstname":"Alzira","lastname":"…
-
2
votes2
answers3309
viewsA: Check if difference between dates is greater than X minutes in PHP
Take the amount getTimestamp() of the two dates and subtracts one from the other, finally divided by 60 who are the second. $dt1 = DateTime::createFromFormat('d/m/Y H:i', '04/10/2016 14:00'); $dt2 =…
-
3
votes1
answer1650
viewsA: Search for relationship whereHas Laravel?
Yes just put it <> in the where Example $query->where('id', '<>', $portal); Also exists the way to compare with whereIn / whereNotIn Examples: ->whereIn('id', [1, 2, 3]);…
-
2
votes1
answer36
viewsA: Improve banking of related entities?
It’s just like you did, it can be done to create like this too: $user->create(array()) ->profissional()->create(array()) ->endereco()->create(array()); but its logic is within the…
-
2
votes1
answer536
viewsA: Multi connections Mysql Codeigniter
Would not be $parceiro_db? $clientes = $parceiro_db->get('clientes')->result(); Doc - Connecting to Multiple Databases There is a problem with the setup on $db['parceiro']['dbdriver'] is set…
-
0
votes1
answer504
viewsA: Listview c# passing value to the next form
Via construtor of classe who receives the ID of ListView. In the code below in evento ListView1_MouseDoubleClick would be a clear example of sending the ID via construtor. using System; using…
-
0
votes1
answer1034
viewsA: How to bring the radio button checked with a Bank result
Have PHP error, correct: <label><input type="radio" name="colaborativa" value="1" {{isset($escola->colaborativa) && $escola->colaborativa == 1 ? 'checked' : '' }}…
-
3
votes1
answer7571
viewsA: Each in JSON jquery date
You’re getting the chave of array and needs the truth of value, then use $.each thus: $.getJSON('http://localhost:8000/produtos', function(data) { $.each(data, function (key, item) {…
-
2
votes3
answers6199
viewsA: Break line in a PHP FPDF class Cell?
For line breaking or commando Multicell: MultiCell(float w, float h, string txt [, mixed border [, string align [, boolean fill]]]) $pdf->MultiCell(0, 20, $texto,0,'L', false); See detailed…
-
1
votes1
answer940
views -
1
votes2
answers864
viewsA: How to pick up space values in JSON
Separation has no problem in loading look at the example! var items = { "Marcas": { "Acura": { "Modelos": ["Integra", "Legend", "NSX"] }, "Alfa Romeo": { "Modelos": ["145", "147", "155"] } }}; var…
-
2
votes2
answers41
viewsA: Action that returns Partialview is not being called
You put the verb in the method BuscarLancamentosProfissional POST, and called for an event Javascript with Jquery.load (load), who calls the Verb get, then, when you send the request to the server…
-
2
votes1
answer2240
viewsA: Change the color of the Datagridview line
Use the dataGridView1.CurrentRow.DefaultCellStyle and let the dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect which is the complete selection of the line:…
-
1
votes1
answer270
viewsA: How to replace a parameter of a PHP function with a file you will receive from a form?
Thus: First you need to take the information that comes from the form and pass to a directory with the function move_upload_file: move_uploaded_file($_FILES['arquivoEnviado']['tmp_name'],…
-
0
votes1
answer118
viewsA: Problems with creating not null fields with Fluentnhibernate
Missing set the default value for this field and pass a value, because when creating a new field in an existing table if no value is passed it has to be null, by default. Soon this will put the…
-
1
votes1
answer1184
viewsA: Relationship of Laravel Tables
I remade the relationships, by seeing that are missing settings and relationships: Menu class Menu extends Model { protected $primaryKey = "id_menu"; protected $fillable =…
-
1
votes1
answer98
viewsA: How to access variables from a previous scope in PHP?
Inherit the variables from parent scope with anonymous functions (closures), referencing by commando use. Example: $message = "hi !!!"; $example = function () use ($message) { var_dump($message); };…
-
0
votes2
answers240
viewsA: String parse for PHP array
I made the logic backwards by taking the array of back to front and when column limit was equal to 4, everything else is key sistArq. In this function pass the directory and file name with…
-
3
votes1
answer977
viewsA: How does Laravel read the file ". env"?
Has a library called vlucas/phpdotenv who has this responsibility in reading the file .env. In the composer.json of Laravel has this package configuration. "require": { "php": ">=5.6.4",…
-
0
votes2
answers246
viewsA: Set connection according to logged user data
The initial logic would be, users (user) would have a configured standard connection. After user authentication create instances of classes who inherit from the Eloquent (os models) as follows:…
-
0
votes2
answers154
viewsA: Transforming a data structure into javascript
First order by chave name with the function Sort, so that the elements are all in ascending order. Make a for and insert in sequence the elements for chave. var items = [ {id: 1,idforeign: 2,nome:…
-
2
votes1
answer281
viewsA: How to make Inner Join inside the Auth in Laravel 5.3
You need to configure both models with the relationship of 1:N (1 for many): Plants class Plantas extends Model { protected $primaryKey = "ID"; protected $fillable = array('Nome'); protected $table…
-
2
votes2
answers419
viewsA: Write access log to ASP NET MVC application
In the Global.asax, within the method Session_Start() do the encoding to write by SessionId (Session.SessionID), one log of information. I’ll propose a way: Create a database with the following…
-
4
votes1
answer96
viewsA: How to read one struct inside another with Json.Net?
That one JSON has a key, so create one more struct as follows: public struct Layout { public SummonerInfo0 kiseryota { get; set; } } public struct SummonerInfo0 {…
-
3
votes1
answer994
viewsA: Call to Undefined method Illuminate Database Query Builder::lists()
The method lists is obsoleta (deprecated) and was replaced by pluck according to Upgrading To 5.2.0 From 5.1, and in the version 5.3 was removed. In fact there was only one change in the name the…