Posts by Raylan Soares • 2,315 points
112 posts
-
1
votes1
answer2025
viewsQ: Pick up records with date greater than the current - Laravel 5.1
I need to list the schedules that have date greater or equal to the current date, I am doing the way below but does not work, it does not return any record.…
-
0
votes0
answers119
viewsQ: Pull logged in user information without using Auth::user()
I have an application developed with Laravel that has some small. php files in the public folder that are loaded in a certain view. I need to pull user information logged in in these files, but I…
-
2
votes1
answer363
viewsQ: Check route with variable on Laravel 5.1
I am using the code below to assign the class "active" when on the route "product" or "product/create". <li {!! Request::is('produto', 'produto/create')? 'class="active"' : null !!}> Now I…
-
1
votes1
answer598
viewsQ: Import csv without duplicating records
I have a spreadsheet with 32000 records, and I need to play for a table in the database. The problem is that in this spreadsheet I don’t have the ID of the records and I can’t let it duplicate when…
-
0
votes0
answers422
viewsQ: Pgadmin4 - Empty Data Output
I installed Pgadmin 4 on my machine with windows 10 64bits, I configured the server, but when I open some table the query seems to run normally, but the tab "Data Output" shows nothing, neither…
-
3
votes1
answer43
viewsQ: I calculate with Javascript inputs
function IBUTG() { $tt = $('[name=tempo_trabalho]'); $vt = $('[name=valor_ibutg_trabalho]'); $td = $('[name=tempo_descanso]'); $vd = $('[name=valor_ibutg_descanso]'); $ibutg = (($tt * $vt) + ($td *…
javascriptasked Raylan Soares 2,315 -
6
votes3
answers833
viewsQ: Balloons with tips for using the system (Tour)
What I want is to know what name is given to those tips that appear to assist in the use of a system when we first enter it. For example, I log in to the system and a little balloon appears as if it…
-
2
votes2
answers2166
viewsQ: Check Empty Fields - Orange 5.3
I have an entire field and a date field that are not mandatory and are programmed to accept NULL, but when I send the form data without filling it in my controller receives the empty value instead…
-
1
votes1
answer378
viewsQ: Error: Array to string Conversion - Select Multiple Laravel 5
In my View I have: <select multiple="multiple" name="carga_mental[]" class="form-control select2"> @foreach($cadastros->where('key', 'carga_mental') as $carga_mental) <option value="{{…
-
0
votes1
answer1176
viewsQ: Get Registry ID created Laravel 5
I have the code below to create a report: $this->repository->create($request->all()); return response()->json(['sucesso' => 'Relatorio cadastrado com sucesso.']); How do I get the…
-
0
votes2
answers1511
viewsQ: How to Reset Form Select2 and Multiselect Fields
I have a registration form where I reset the fields when entering a record with the following: document.getElementById(id).reset(); //Aqui passo o id do formulário The problem is I have a field now…
-
5
votes1
answer1374
viewsQ: Create Unique constraint with two fields in the Laravel request
I have in the creation Migration of my table the following: public function up() { Schema::connection('database2')->create('empresa_funcoes', function(Blueprint $table) {…
-
0
votes2
answers246
viewsQ: Set connection according to logged user data
I created a second connection in my config/database.php file and I will also create a third one, I wanted to know how to switch between these connections according to the logged in user.…
-
4
votes1
answer194
viewsA: How to list the depedents of a particular employee with Laravel?
In his Model Funcionario do this: public function todosDependentes(){ $this->hasMany('App\Dependente'); } In his Model Dependente do this: public function funcionario(){ return…
laravel-5answered Raylan Soares 2,315 -
0
votes1
answer281
viewsA: Assign and send unchecked checkbox value in Larevel
Well, I decided to remove the function to assign a value when the checkbox is unchecked and make a change to my controller: $data = $request->all(); if(!$request->get('ppp')){ $data['ppp'] =…
-
0
votes1
answer281
viewsQ: Assign and send unchecked checkbox value in Larevel
I have a form where the user can enable or disable certain options by checking or not a checkbox. <input name="ppra" type="checkbox" data-oFF-text="INATIVO" value="1" data-off-color="danger"…
-
2
votes1
answer601
viewsQ: Commit a vendor folder file
My vendor folder is by default ignored and I know this is the right one, but it turns out I need to commit a specific file that is in this folder, would that be possible? If not, what other solution…
-
2
votes1
answer96
viewsQ: List errors returned in an ajax request
I have a Controller that is returning errors this way: return response()->json(['erros' => $this->renderHttpException($e)]); I am receiving this json as a response to the ajax request:…
-
1
votes2
answers586
viewsQ: Hide or delete row from table when delete record
I have a table that displays a client list and has a fluff on the side to exclude each customer. I want to make this deletion via ajax, how do I make the line that is the client that was deleted…
-
2
votes2
answers3637
viewsQ: Filter records by month and year in Laravel
I have a form with a field like month, that sends a value in the format Y-m for my controller. How do I search the records for the selected month and year? I’m using L5-Repository I did it this way,…
-
3
votes3
answers12026
viewsQ: Vertical text with css (90º)
I’m turning a word document into html, but I don’t know how to write the text this way: Would anyone know how?…
-
0
votes0
answers27
viewsQ: Filter Used and Unused Classes Twitter Bootstrap
I’m importing bootstrap to a landing page, but because the content is little, the classes I needed to use are also few. I wanted to know if you have any automated way to filter which classes I am…
-
0
votes1
answer130
viewsQ: Update a record with a single field
I’m using the L5-Repository in my project, but I’m having the following difficulty: I have the code below to make the Slug is unique, but when I update it says Slug already exists, when in fact it…
-
1
votes2
answers3391
viewsA: Validate captcha before sending form
Well, I got it this way: In my captcha input I call a function Cap(): <form method="post" action="#" id="form" name="form"> <!-- campos --> <div class="form-group">…
-
1
votes0
answers616
viewsQ: Slow PDF creation - DOMPDF Laravel5
I am currently using the Barryvdh Dompdf to create reports in a system made with Laravel 5.1, but it is very slow because of the size of the reports, so that, for many times (almost always), it ends…
-
3
votes2
answers3391
viewsQ: Validate captcha before sending form
I need a very simple captcha, but it can be validated before the form is sent, how can I do it? Currently use this: index.html <form method="post" action="valida.php" id="form" name="form">…
-
1
votes1
answer169
viewsA: Dynamically Set Connection in Model Laravel 5.1
Well, I found that answer in the English OS that helped me to solve this in the following way: class Aparelho extends Model { protected $connection; function __construct() { return…
-
0
votes2
answers5344
viewsA: Is it possible to capture the current url in the Blade view?
I do it like this in the Valley: //http://localhost:8000/user/teste //Pegar o primeiro que é "user" Request::segment(1) //Pegar o segundo é "teste" Request::segment(2) It already ignores the default…
-
1
votes1
answer169
viewsQ: Dynamically Set Connection in Model Laravel 5.1
I saw that I can use different connections for my models by defining as follows: class Aparelho extends Model { protected $connection = 'minha_conexao'; protected $table = 'aparelhos'; } But how can…
-
1
votes1
answer380
viewsQ: Authenticate in a database and change information in others
So, I need to create an application with Laravel 5 where it is possible for different users to be authenticated in a specific database where the system is. After logging in, each user can change…
-
1
votes1
answer184
viewsA: How to send notifications from a website to the user via the Browser
I recommend using the Pushcrew for this, it is very easy to configure and implement. Register and personalize the appearance and messages as you see fit, although it is in English is very easy to…
-
1
votes1
answer1002
viewsQ: How to center Google reCaptcha?
I have a reCaptcha in my form, but I’m not able to center it or leave it in the same size as the fields. <div class="container-fluid"> <div class="row"> <div class="col-sm-10…
-
1
votes1
answer964
viewsQ: Slow loading with Jquery Datatables plugin
I am using Jquery Datatables in a small system and everything was fine until I came across a listing of almost 2500 records... The point is that it takes a certain amount of time for the information…
-
2
votes1
answer1704
viewsQ: How to select a <option> of <select> with javascript/jquery
I have two selects, one for the employee and one for the function, where it is necessary that when an employee is selected the function of the employee is already automatically selected. That one…
-
7
votes1
answer259
viewsQ: Hide Divs with similar ID
I have several tags div with the similar id, they all start with cn-, example: <div id="cn-name">...</div> <div id="cn-email">...</div> <div…
-
2
votes2
answers613
viewsA: How to return a collection of objects via ajax?
I went soft... just put the get in the end. if($info = Funcionario::where('id_empresa', $request->get('empresa'))->get()){ return $info; }
-
1
votes2
answers613
viewsQ: How to return a collection of objects via ajax?
I created this function in my Controller to return a list of employees in my ajax request, but it is not returning anything. public function getFuncionarios(Request $request){ if($info =…
-
1
votes1
answer59
viewsQ: How to count underage employees?
I use the code below to display the number of active employees: {{ $relatorio->Empresa->Funcionario->where('id_status', 1)->count() }} How do I count only employees under the age of 18?…
-
1
votes4
answers1058
viewsQ: Get the first 2 user names
Let’s say my selected user name is "Raylan Soares Campos", how do I display only the first two names? In the case "Raylan Soares". I’m using Laravel 5.2, I don’t know if you have any facilitator or…
-
0
votes1
answer21
viewsA: Customize e-mail sent by wp e-commerce plugin
Well, I managed to find the file: wp-content/plugins/wp-e-commerce/wpsc-includes/Purchase-log-notification.class.php On it we can make changes to the information that is sent by e-mail.…
-
1
votes1
answer21
viewsQ: Customize e-mail sent by wp e-commerce plugin
I use wp e-commerce on a website for customers to quote, but I would like to customize the email that is sent to site administrators when an order is placed. I need to do this without preferred…
-
0
votes1
answer44
viewsQ: Write to a csv file with JSP without overwriting what you already have
I have this code below to record information in the csv file, but whenever I record something, what I have already written is lost. How do I get him to add a line with the new information keeping…
-
2
votes2
answers3681
viewsQ: How do I get JSON from a URL to use in my PHP file?
I want to get the value of the JSON dollar displayed in this URL: http://api.promasters.net.br/cotacao/v1/valores?moedas=USD&alt=json to use in my php file, you can only do this with PHP? Also…
-
3
votes0
answers98
viewsQ: Documentation for a system
I’m in the middle of producing a web system, actually almost at the end... The point is that no documentation was developed for the system, it was all being developed "directly", based on another…
documentationasked Raylan Soares 2,315 -
1
votes2
answers860
viewsQ: Array of unique values with foreach
I got the following foreach to pick up the id of the devices that were used in each sector: @foreach($relatorio->Empresa->SetorEmpresa as $setor) {{ $collection[] =…
-
0
votes1
answer26
viewsA: Filter and count related model data
Well, I got it this way: {{ $adm = 0 }} @foreach($empresa->SetorEmpresa->where('tipo', 'Administrativo') as $setor_adm) {{ $adm += $setor_adm->Funcionario->where('id_status',…
-
10
votes2
answers28807
viewsQ: How to insert a first line indent with css?
I don’t know if the name is even indent, but how do I apply this space as in the image below in my paragraphs with css? Have some class in bootstrap?…
-
0
votes1
answer26
viewsQ: Filter and count related model data
Enterprise hasMany Setorempresa Setorempresa belongsTo Enterprise Setorempresa hasMany Functionary Functionary belongsTo Setorempresa With this data in hand, how do I count how many id_status = 1…
-
2
votes2
answers833
viewsQ: Footer does not appear on the first page - Laravel Dompdf
I have the following code in my application to generate a PDF report: $head = '<html><head>' . '<title>Relatório</title><style type="text/css">' . '@page {margin: 120px…
-
2
votes1
answer241
viewsQ: How to make a "select distinct" on a model in Laravel?
I’m pulling the data from a table to a select, but I have fields where the information is equal, for example: Controller: $amostragens = Amostragem::all(); View: @foreach($amostragens as…