Most voted "laravel-5" questions
Laravel is an open-source framework for developing web applications and services with PHP. Use this tag for specific questions about Laravel 5 or later.
Learn more…751 questions
Sort by count of
-
0
votes1
answer505
viewsHow can I list 3 tables using Laravel
Hello, I need some help with Relationships. I’m studying Laravel and I came across this problem. I could use Join, but wanted a simpler way and use Laravel’s relationships to do this kind of search.…
-
0
votes0
answers179
viewsHow to view multiple content on @Yield from Laravel’s Blade template system?
Well, I have a site in progress in the programming language of Laravel. In my welcome.blade.php I created a @yield so-called sides After the creation of that yield, created the folders in my…
-
0
votes1
answer29
viewsCreate in table related to another table does not work
I’m having trouble inserting into two related tables, the Peoples and Addresses tables. Insertion is being done only in the Peoples table. The relation in the Addresses table is made between the…
-
0
votes1
answer387
viewsProblems with table linkage in the Standard
When I type php artisan migrate it generates this error: Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1005 Can't create table `blog`.`produtos` (errno: 150 "Foreign key…
-
0
votes1
answer25
views"Unexpected data found" on function return
I have a function that should return a json from a Collection generated by a Builder query. $today = Carbon::today()->format('Y-m-d'); $tasks = Task::where('date',…
-
0
votes2
answers518
viewsHow 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' =>…
-
0
votes1
answer1607
viewsUndefined Property: stdClass
I have a question regarding an array. I have the following information: What I’m not getting is to go through the other array. Below is the code. foreach ($file_contents->retorno->contatos as…
-
0
votes1
answer230
viewsFilter results using 3 tables in Laravel 5.8?
Create in controller a filter that takes data from 3 different tables. Below I put the relationship and an example of what needs to happen. I am not able to create in controller the filter that…
-
0
votes2
answers88
viewsHow to feed an array using data from another array in php?
Does not accept the foreach? { $ssparray = array( //Array numérico sendo a segunda dimensão. 'mensagem' => array( 'mensagem' => 'OK - preventiva realizada', 'usuario_api' => 'userapi',…
-
0
votes1
answer38
viewsHow to show only the posts of the logged-in user?
I have a question at the moment of showing the post user only who is logged in? Man model: class propuestas extends Model { protected $fillable = ['titulo', 'descripcion', 'estado', 'linea_id',…
-
0
votes1
answer72
viewsFailed to parse time no eloquent
I have the following code: select('id','title', 'description', 'author', DB::raw("DATE_FORMAT(created_at,'%d/%m/%Y') AS created_at"))->get(); when I run it returns me the following error: erro":…
-
-1
votes2
answers82
viewsLaravel does not return variable passed by with
Hello guys beauty? Why Laravel is not resuming the object in the view. Searching for the session I can get the data. /* ProdutoController */ public function deleta($id){ $prod = Produto::find($id);…
-
-1
votes1
answer477
viewsLaravel with Site + Cms + Intranet
I’m creating a website that will contemplate a cms and an intranet. In Cakephp I separated these applications with plugins, that is, site at the root of the/cake project and plugins for others. Very…
-
-1
votes2
answers77
viewsFramework Laravel
I’m new with Laravel Framework 5.3 and can’t change the default index, which is the file /Resources/views/welcome.blade.php. I tried two things: Change the default file; Create a new file and swap…
-
-1
votes2
answers628
viewsHow do I search a combo field as I type the text?
I have a combo field with over 2,000 records. It’s hard to select what I need. I am in need of something (Bootstrap?) that as I type a part of the word the combo will position itself in the typing…
-
-1
votes1
answer318
viewsHow to give permission to write temporary files in the c windows tmp folder with Laravel 5.4?
I would like you to help me solve this problem: How to give permission to write temporary files in the windows tmp c folder with Laravel 5.4?
-
-1
votes1
answer473
viewsSelect multiple checkbox with foreach, coming from the bank in Aravel?
I’m populating a checkbox with the bank information, I’m trying to get it to read all the checkbox selected. Controller public function store(RequestProduto $request) { $data = new Produtos;…
-
-1
votes1
answer33
viewsAuthenticated/Not Authenticated Redirect
When we protect a route by login and try to access this route without being logged in the log-in sends us to the login screen. So if you authenticate it sends to that route you tried to access…
laravel-5asked 6 years, 1 month ago Vinícius Pereira Gonçalves 29 -
-1
votes2
answers914
viewsRedirect to another PDF tab
Hey, I need some help! My current project needs to generate a report from one table, great I did with Dompdf, my doubt is how I make the pdf open in another tab and not in the current tab. The…
-
-1
votes1
answer17
viewsHow to generate dynamic urls
I’m working on a project for writers to publish poems and poetry. Urls will be separated by gender, for example: site.com/poems/field flowers/ However, I need to avoid double titles. Because of this…
-
-1
votes2
answers337
viewsLaravel 5.8 find with column name other than "id", how to do?
Good Morning In my controller to make the Show view work I have following code public function show($id){ $produto = Produtos::find($id); return view('produtos.produtosShow', array('produto' =>…
-
-1
votes1
answer405
viewsImage does not appear in view, in production environment
I have the path of the images saved in the database, and the images in a folder inside the public folder (filename/public/image-post/post_id_2.jpg). in development environment, it usually appears in…
-
-1
votes1
answer82
viewsSQLSTATE[HY000] [1105] (proxy) error all backends are down (SQL: select * from `users` Where `id` = 1 limit 1) Standard
I have a website developed in Laravel 5.8, put on the air, and when I am browsing the site I get this error: SQLSTATE[HY000] [1105] (proxy) all backends are down (SQL: select * fromuserswhereid= 1…
-
-1
votes1
answer280
viewsLaravel - do DB::table() without using Join
I’m playing with Aravel and I’m learning object orientation and I wanted to make a select without using the Join as and object oriented and I know little n I’m getting. as I’m used to using:…
-
-1
votes1
answer338
viewsDoubt: Scroll through a PHP Laravel multidimensional array
How to Optimize Traversing Data from the Laravel Multidimensional Array in the Controller and The Result Reflected in the View. Example:…
-
-1
votes1
answer772
viewsLaravel - Hasone 5.8
I have no problems with registering related data in Hasone I have doubt about registering 2 hasOne data... I know that to register two hasOne data is as follows example: $users = User::create([…
-
-1
votes1
answer114
viewsLaravel 5.8 - Relationship listing
I have the following code in my controller funcionarios::with('user', 'rh')->get()returns all beautiful related data but only the first record is really related sure the others in the RH…
-
-1
votes1
answer419
viewsCheck field only if it has any Laravel value
Guys I have a user registration system, in this system has a CPF field, where I use a class to validate it, but the field is not mandatory, and all the classes I tried to validate Cpf, validates…
-
-1
votes1
answer400
viewsLaravel: Take the value of an array without foreach
I have the following appointment: $TenantId = DB::select('select tenant_id from users where id = :id', ['id' => '7']); dd($TenantId); The result of $Tenantid is: array:1 [▼ 0 => {#357 ▼…
-
-1
votes1
answer173
viewsAssociative table in Laravel 5.8 (Migrate)
I am making a system for a school in the automotive sector that offers courses, this system the user will be able to register the courses and view them, in general, will be a panel for him to…
-
-1
votes1
answer636
viewsHow 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…
-
-1
votes2
answers120
viewsHow to customize user validation rule with multiple access levels?
I need to do a validation in the user registration where an email can only be validated if in the table users your level of access is not company level. On the table users, there is already a field…
-
-1
votes2
answers916
viewsHow to integrate the awesome font in Laravel?
I’m using the awesome font in Windows along with bootstrap, until then used via Link, both css and js. Today I’m migrating to control via npm, but I install and the icon does not appear. They can…
-
-1
votes1
answer348
viewsHow 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' => […
-
-1
votes1
answer169
viewsPhpmailer email sent successfully but not received Amazon SES
I’m using Amazon’s Phpmailer Laravel SES. My account is not in a sandbox. My problem is when I try to email the Laravel admin panel on my website to my customers. I am informed that it has been…
-
-1
votes1
answer38
viewsDoubt of structure using Global Scopes in Laravel
A doubt of structure. Scenario: I have 3 users: administrator, stores, customers. I have a product model and I want to define a global Cope in it so that when stores access the product listing the…
-
-1
votes1
answer130
viewsPicking up API data
Good Morning, I am taking data from an API and it returns me 100 records per page, however it does not tell me how many pages there are of record. The only information that is passed to me is when…
-
-1
votes1
answer59
viewsProblems to delete with ajax in Laravel 5.3
Controller public function deletar($id) { $dado = Todo::find($id)->delete(); return response()->json($dado); } Route Route::get('/deletar/{id}',['as'=>'todo.deletar',…
-
-1
votes1
answer49
viewsSkip foreach result every two results
I have some results in the bank and need to align them according to the image below. But I could not. I am doing in Laravel 5.8. <table style="border-collapse: collapse; width: 100%;"…
-
-1
votes1
answer86
viewsHow to insert null values into a data list?
I believe the problem is here: 'tlkc_conversation_2' => '', I am trying to enter data in the database, but some fields are null, and I am receiving the following message: Illuminate Database…
-
-2
votes1
answer101
viewsError picking up data for a view
I’m trying to bring the data to a view to perform some tests on Laravel but it’s not working Controller class ProfileController extends Controller { private $aluno; private $request; public function…
-
-2
votes1
answer598
viewsBest Practice for Mass Assignment
To obtain the facilities that the framework proposes, in the specific case of saving data in a table of a database, we can use the mass assignment resource, which means, in free translation, 'mass…
-
-2
votes3
answers1027
viewsLARAVEL 5.3 Blade template is not updating the page
Good morning. I’m a beginner in the PHP Laravel framework and I’m having the following difficulty: I write my html inside my .blade.php file and call it in a view on Route but the information I…
-
-2
votes3
answers945
viewsRegister user with Laravel
I am setting up an application, where it is made registration of an employee, and this employee belongs to a company, which comes from the table users. When I do the registration process, the…
-
-2
votes1
answer27
viewsIgnored validation rule
Greetings, I’m having trouble making a validation by Laravel. Today, I need to do the following validation 'data_visita' => ['required', 'date_format:d/m/Y', new AfterOrEqual1900], when you’re…
-
-2
votes1
answer123
viewsCalculate value (R$) based on PHP time
I need to calculate the value of a service based on time. I managed to do this part, I will make the code available here. The problem is that I need to do the reverse, calculate the hours based on a…
-
-2
votes1
answer83
viewsLaravel does not generate error while processing form with 'post'
I’m taking a course of Laravel, and in the course the instructor used a form that points nowhere to show a mistake of the type MethodNotAllowedHttpException. Until then, fine, but when processing…
-
-2
votes1
answer389
viewsGet number of followers on instagram with PHP
I have the following code: $username = 'makeup.pro.br'; $response = @file_get_contents( "https://www.instagram.com/$username/?__a=1" ); if ( $response !== false ) { $data = json_decode( $response,…
-
-3
votes1
answer86
viewsI need to return this JSON with Laravel eloquent
Meu Json: { "data":[ { "data":{ "name":"Documents", "size":"75kb", "type":"Folder" }, "children":[ { "data":{ "name":"Work", "size":"55kb", "type":"Folder" }, "children":[ { "data":{…
-
-4
votes1
answer249
viewsComposer/Laravel...[BUGS]
Hello, I’m with a system in php to give maintenance...only I wanted to upload the application to do the tests and I’m not succeeding,I searched the net did some things, and even so I come across…