Posts by André Cabral • 811 points
58 posts
-
4
votes3
answers117
viewsQ: Limit HTML content in Divs and distribute in the following dynamically?
I’m trying to distribute the content HTML(texto,imagens etc) in DIVS dynamically, but I haven’t found anything related to this yet. Like picking up content from outside the DIV (overflow) and insert…
javascriptasked André Cabral 811 -
0
votes1
answer200
viewsQ: How do I list data from a model that receives a JSON but an array in the structure?
The goal here is to list the array tracking, but it presents this error below when I try: ERROR: Exception has occurred. Nosuchmethoderror (Nosuchmethoderror: The method '[]' was called on null.…
-
-1
votes1
answer114
viewsQ: How to edit a record with union fields in the Standard?
I am not able to edit the registry with single emails always says that the value already exists when I try to save the record. URL: http://dominio/dashboard/admin/franqueados/11/edit REQUEST: public…
laravelasked André Cabral 811 -
-1
votes1
answer348
viewsQ: How to download private files in Windows?
The idea is to upload confidential documents, so I can’t put them in the folder /public. The goal is that in the views I can access these private files. Local: 'disks' => [ 'local' => […
-
2
votes1
answer945
viewsQ: How to run a link after Sweetalert confirmation?
Link <a onClick="enviaDivida()" href="{{ route("admin.dividas.edit",$divida->id)}}" class="btn btn-sm btn-clean btn-icon btn-icon-md" title="Enviar"> <i class="la la-send"></i>…
-
0
votes1
answer48
viewsQ: Concatenate strings in the parameters of a function?
I need to inject the v as simple quotation marks 'v' in the concatenation of código onClick="validaContato(1,'v') // resultado desejado no segundo parametro code var botao = '<div…
javascriptasked André Cabral 811 -
3
votes2
answers118
viewsQ: How to remove a class of multiple elements whose names obey a certain criterion
I need to remove all classes starting with btn-*. My script: if (document.getElementById('contato_'+id).classList.contains('btn-danger') ){…
javascriptasked André Cabral 811 -
1
votes2
answers603
viewsQ: How to update a row in the table with ajax?
The idea is to click the valid or invalid button and update that line in the table, changing the class of the button to the respective situation class: valido or class: invalido with ajax. My…
-
-1
votes1
answer104
viewsQ: Error trying to access Auth::user()->id, in Laravel 5.8
Error: Auth::user()->id trying to get a property of a non-object Model: <?php namespace App\Models; use App\Scopes\Tenant\TenantScope; use App\User; use Illuminate\Database\Eloquent\Model; use…
laravelasked André Cabral 811 -
2
votes1
answer36
viewsQ: Implementation error
I’m calling the class TenantScope in the model Cliente and makes a mistake Tenantscope.php namespace App\Scopes\Tenant; use App\Tenant\ManagerTenant; use Illuminate\Database\Eloquent\Model; use…
-
1
votes1
answer58
viewsQ: Error while running Migration
Error: 1005 Can’t create table 'cobranca_simples. #sql-f04_1f0' (Errno: 150) (SQL: alter table carteira_cliente add Constraint carteira_cliente_carteira_id_foreign Foreign key (carteira_id)…
-
0
votes2
answers40
viewsQ: How to return a value from a checked column?
I’m trying to get the ID of the selected line with :checked but I’m not getting it. HTML <table id="dividas"> <thead class="thead-inverse"> <tr> <th>#</th>…
-
-1
votes1
answer82
viewsQ: How to find an ordinary sequence of Keys in an Array?
The goal is to find the next ordinary sequence of 03 Keys within a array with broken indexes, in the example would be 4,5,6 or 7,8,9 CODE <?php $myArray = array( 'item_1', 'item_2', 'item_3',…
-
1
votes1
answer211
viewsQ: Remove an item from the list of a php array?
PROBLEM: In the $reserved array the item "09:00" is not being removed with the unset() method inside the foreach. CODE: $start = "09:00"; $end = "17:00"; $padding = 60; $almoco = [ "12:00", "13:00",…
phpasked André Cabral 811 -
0
votes0
answers195
viewsQ: How to log a component imported with Vue.js correctly?
error: Unknown custom element: - Did you Register the Component correctly? For recursive Components, make sure to provide the "name" option I am trying to register a component containing a form but…
-
1
votes1
answer3143
viewsQ: What to do to call a function from another controller in Laravel? I would like to implement best practice
I have a boletosController controller need to call the Function create in the tradeController; boletosController.php; namespace App\Http\Controllers; use App\Repositorios\Boletos; use…
-
1
votes2
answers55
viewsQ: How to get a value from an array property?
A VÁRIAVEL ARMAZENZA: $parcelas = DB::select("SELECT parcela_number FROM parcelas WHERE 3000 BETWEEN valor_min AND valor_max"); VAR_DUMP: array(1) { [0]=> object(stdClass)#144 (1) {…
-
0
votes3
answers89
viewsA: With putting together a query on Eloquent?
Solution for this case: $valor = 2500; DB::select("SELECT juros FROM parcelas WHERE $valor BETWEEN valor_min AND valor_max");
-
1
votes1
answer36
viewsQ: How to insert the error return into a specific part of html?
JAVASCRIPT $(document).ready(function(){ $('#parcelas').on('change', function(){ var parcela = this.value; var entrada = document.getElementsByName("entrada")[0].value; $("#bodyBoletos").html("");…
-
-4
votes3
answers89
viewsQ: With putting together a query on Eloquent?
How do I put this query in Eloquent? SELECT juros FROM tbl_parcelas WHERE 2500 BETWEEN tbl_parcelas.valor_min AND tbl_parcelas.valor_max CODE: DB::table('SELECT juros FROM tbl_parcelas WHERE 2500…
-
0
votes3
answers196
viewsQ: How to select to find a record between two values?
I have a table with the following values # valor_min vlr_max juros 1 0 1999 0 2 2000 2999 1.2 3 3000 3999 1.3 4 4000 999999 1.4 I need to consult this table with the value ex.: 2500,00 find the…
-
2
votes1
answer78
viewsQ: How to rent plots matching the total?
$meses = 3; $valor = 1000 $valor_parcela = $valor / $meses; for ($i = 1;$i <= $meses; $i++) { $date_sum_month = date('d/m/Y', strtotime("+{$i} month", strtotime($date))); array_push($boletos,…
-
3
votes1
answer40
viewsQ: How to insert an element into an array[]?
THIS EXAMPLE ONLY RETURNS ME THE FIRST ITEM; $parcelas = 2; $valor = 1500; $date = '2019-12-23'; $valor_parcela = $valor / $parcelas; $boletos = []; for ( $i = 1; $i <= $parcelas; $i++ ) {…
-
0
votes2
answers93
viewsQ: How to implement two Request to validate individual and legal fields?
If the type of person selected is F is valid through the FisicaRequest public function store(FisicaRequest $reqFisica, JuridicaRequest $reqJuridica) { if ($reqFisica->tipo_pessoa == "F") { $data…
-
0
votes2
answers518
viewsA: How to send $array with the Post method in Windows?
I DECIDED TO TRADE FORM_PARAMS FOR JSON: Route::post('/boleto-create', Function () { $data = array( 'amount' => 1, 'due_date' => '2019-08-03', 'customer_document_number' => ' "1"',…
-
0
votes2
answers518
viewsQ: How to send $array with the Post method in Windows?
ERROR RETURNED The GET method is not supported for this route. Supported methods: post. MY ROUTE Route::post('/boleto-create', function () { $data = array( 'amount' => 1, 'due_date' =>…
-
1
votes1
answer40
viewsQ: How do I set the date of Bootstrap Datepicker to null?
When I send the data for validation, it is stated that the field has a completed date, like today’s date. I would like to set as null at first obliging the user to fill in the field. DATEPICKER…
-
2
votes2
answers1356
viewsQ: Bootstrap Datepicker doesn’t work?
HTML <input type="text" id="datepicker" class="form-control"> THE SCRIPT IS LOADING NORMALLY <script src="{{ asset('js/bootstrap-datepicker.min.js')}}"></script> JAVASCRIPT…
-
0
votes2
answers242
viewsQ: How to instantiate one model inside the other in the view?
Error: Property [id] does not exist on this Collection instance. MIGRATION DIVIDE <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use…
-
1
votes1
answer60
viewsQ: How to recover an interval of months between two dates?
public function getMesesAtraso() { $data_debito= date_create($this->data_debito); return date_diff(date_create(now('m')), $data_debito)->format('%m'); } Returns only months in 2019…
-
0
votes2
answers110
viewsQ: How to update a table with an array in the Laravel?
CONTROLLER CODE $form_data = array( 'numdoc' => $request->numdoc, 'data_emissao' => $date_emissao, 'data_debito' => $date_debito, 'cliente_id' => $request->cliente_id, 'devedor_id'…
-
0
votes2
answers67
viewsQ: How to format date field in datatables?
current code return datatables()->of($query->get()) ->addColumn('action', function($data){ $button = '<button type="button" name="edit" id="'.$data->id.'" class="edit btn btn-primary…
laravelasked André Cabral 811 -
0
votes2
answers88
viewsQ: How to recover calculated fields in Laravel?
My Edit controller $tipos = TituloTipo::all(); $devedores = Devedor::all(); $clientes = Cliente::all(); $divida = Divida::find($id); return…
-
0
votes3
answers576
viewsQ: How to get the ID value of a button?
In the ID there is a dynamic value, so I would like to get that value without just clicking map the button and store in a var: <button name="edit" id="valor_dinamico">Edit</button>…
-
1
votes1
answer39
viewsQ: Nothing happens in Success, even if Json returns
The return is giving 200 Json, but nothing is excommunicated in Success. $(document).on('click', '.edit', function(){ var id = $(this).attr('id'); $('#form_result').html(''); $.ajax({…
-
0
votes1
answer32
viewsQ: How to recover a data with Select2 in the registry edition?
Follow the code of Lade, when I go to edit mode the corresponding data does not appear and yes Lect2 is empty. <select name="cliente_id"> <option value=""></option> @foreach…
-
-1
votes1
answer636
viewsQ: How to use the SUM in the Laravel?
MODEL CUSTOMERS public function titulo() { return $this->hasMany('App\Models\Titulo'); } MODEL TITLE public function cliente() { return $this->belongsTo('App\Models\Cliente'); } MIGRATION…
-
0
votes0
answers41
viewsQ: Authentication routes not defined, Standard 5.7
I can’t access the route http://localhost/login directly and nor http://localhost/logout. Route::get('/', function () { if(Auth::check()) { return redirect('/dashboard'); } else { return…
-
2
votes1
answer63
viewsQ: How to recover old values from select inputs?
Follow the code of the Lade: <select name="tipo_id" class="form-control col-md-3 col-xs-12"> <option value=""></option> @foreach ($tipos as $tipo ) <option name="tipo_id"…
-
-1
votes1
answer531
viewsQ: Store Laravel 5.7 date fields?
I’m not finding a solution to store only date, always required time. Error: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value
-
0
votes1
answer23
viewsQ: Error searching for Description in another related table
Error: Trying to get property of non-object View @foreach ($titulos as $titulo) <tr> <td>{{ $titulo->id }}</td> <td>{{ $titulo->titulo_tipos->description…
-
0
votes1
answer156
viewsQ: How to store select input data with Laravel?
I cannot send the selected data to the request: <select name="tipo_id" class="form-control col-md-3 col-xs-12"> <option value=""></option> @foreach ($tipos as $tipo ) <option…
-
0
votes1
answer39
viewsQ: Error typing numeric values in input
When entering values in inputs the calculations are quite different, but when loading the application with the values filled the application wheel template <div id="simulador"> <div…
-
0
votes1
answer179
viewsQ: Laravel 5.4 (1/1) Tokenmismatchexception
Locally all forms work, but when I put online is giving erro as if I didn’t have the _token attributed to forms. APP_NAME=MonkStudio APP_ENV=production…
-
3
votes4
answers4452
viewsQ: Navbar Collapse does not work!
Follow the code for analysis: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html…
-
2
votes1
answer47
viewsQ: How to return an integer value for the Rows in the codeiginter?
How do I return an integer value for the rows returned in select? $query = $this->db->where("categoria_titulo", $categoria); $query = $this->db->get("categorias"); $query =…
-
0
votes1
answer311
viewsQ: Permission to shutdown now!
How do I give permission to execute the command shutdown to the user ? I am using OS Linux Mint 13.
-
0
votes2
answers3751
viewsQ: How to run scripts on Centos startup?
Good afternoon, how do I run a script in Centos 6.5? I’m running into /etc/rc.local /etc/rc.d/rc.local and is not loading the commands: sh /etc/init.d/script the command works outside the script.…
-
0
votes0
answers70
viewsQ: Error creating JOB on Oracle 11g
When I will create a job in oracle is appearing this error. ORA-01882: Timezone Region %s not found. How to solve this problem?
oracleasked André Cabral 811 -
4
votes2
answers3709
viewsQ: How do I update multiple rows of a table after it undergoes a certain change?
CREATE or REPLACE TRIGGER TG_ATUALIZA_BLOQUEIO AFTER UPDATE ON pcclient FOR EACH ROW begin if :NEW.BLOQUEIO = 'S' THEN UPDATE PCCLIENT SET BLOQUEIO='S' where codcliprinc=:OLD.CODCLIPRINC; END IF;…