Most voted "laravel" questions
Laravel is an open-source framework for developing web applications and services with PHP. Before asking consult the official documentation of Laravel.
Learn more…2,777 questions
Sort by count of
-
2
votes1
answer153
viewsLaravel, when performing a query per model, how to say that a hasManyThrough relationship must contain these items?
Well, I found myself in the following situation, I own the entities Vehicle, Vehicle and Optional, where Vehicular is a pivot between the two. Beauty, there is a vehicle filter on the main page…
-
2
votes2
answers552
viewsHow to insert a midnight datetime into mysql?
I’m using the Laravel Framework 5.8, I am trying to register a record in the database where I need to set in API some dates. Although they are CURRENT_TIMESTAMP, i also need to be able to enter a…
-
2
votes1
answer279
viewsWhat’s wrong with this non-responsive paging using boostrap 4 in Laravel?
I’m using Laravel to make a system, along with the framework Bootstrap. And I’m using the paging feature. However, I’m having trouble making the pagination numbers responsive. Both are not…
-
2
votes1
answer36
viewsImplementation 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…
-
2
votes0
answers181
viewshiding id the LARAVEL url
Good morning guys, someone help me I’m trying to hide the id. as it appears: http://localhost:8000/admin/client/edit/1 I want it to stay that way http://localhost:8000/admin/client/edit without…
laravelasked 5 years ago user160990 -
2
votes2
answers395
viewsIf select Laravel
I have a question here and I would like some help. I have a controller where you have to make a query in the Boxes table where you check whether the box is open or closed. public function…
-
2
votes1
answer29
viewsProblems with Return Botman + Httpful
My project consists of a chatbot that receives user information, consults an api created by me with this information, and must present to the user the return of this query. This return is a list of…
-
2
votes4
answers135
viewsQuey Builder with IF condition in Lockable
People I have a problem to list certain results of a database using Arabic, and I have tried everything to elaborate a logic to list these results and I can not elaborate this logic. I have a table…
-
2
votes1
answer57
viewsDoubt using Repository in Laravel
Personal talk! Following the idea of Boilerplate http://laravel-boilerplate.com I have a Repository like this: class EmpresaRepository extends BaseRepository { public function __construct(Empresa…
-
2
votes1
answer919
viewsProblem with CORS using Vue + Laravel (only GET method works)
Vue: CLI 3 Laravel: 6 When trying to use different GET requests (e.g.: POST, DELETE), I get the following message: Access to Xmlhttprequest at 'http://127.0.0.1:8000/api/test' from origin…
-
2
votes1
answer100
viewsConsultations nestled in Laravel
I’m starting at Laravel now and I’m having some difficulties when it comes to "consultations". I’m using the latest version of Laravel which, if I’m not mistaken, is 7.4. When I worked with pure PHP…
-
2
votes0
answers60
views -
2
votes2
answers49
viewsQuery to return minimum amount of "different" values
I have a table called clientes and this table has a column status which may have +/- 3 types (novo, cancelado, pendente...) need to display a quantity of information separated by status, and instead…
-
2
votes1
answer301
viewsChange Laravel directory /directory 8
I’m in trouble, using LARAVEL 8 and Voyager installed. When logging in via SSH on my shared server I am in "public", its going down a level I go to "meusite.com.br" here upei all the files and…
-
2
votes2
answers87
viewsHow to authenticate a user when the "username" field receives values that can reference different columns in the database table?
I have a login form where I have the fields "username" and "password". The difficulty I have been finding is the following: I want to give the option of the user to log in by CPF, email or phone (in…
laravelasked 3 years, 9 months ago Gato de Schrödinger 2,367 -
2
votes2
answers132
viewsMake the input text field mandatory if the corresponding checkbox is selected
[The solution was with Javascript, I will put at the end of the code] Guys, this my code works perfectly, when a checkbox is selected the input related to it appears but if I do not fill it and put…
-
2
votes0
answers19
viewsBase table or view not found: 1146 Table doesn’t exist Laravel 8.0.4
I upgraded my Standard to version 8.0.4 and now my project has the following error when I try to run php Artisan serves. I have 4 database connections, and only one is the main one and is where the…
-
1
votes3
answers572
viewsError with complementary routes in Laravel 4
Initially, I created the following route (1st search): Route::get('/buscar/profissoes/{city_id_slug?}', array('as' => 'neighborhoods.city', 'uses' => 'NeighborhoodsController@getIndexCity'));…
-
1
votes1
answer135
viewsPackage for validations per service
I’m developing a large project with Laravel and I need to validate my data. Initially I had thought to use Ardent, but this is not compatible/advisable for those who use the repository standard.…
-
1
votes2
answers233
viewsNusoap using Laravel 4
I’m creating a Webservice in the Laravel with the library Noiselabs. Route::any('x/ws/hello', function(){ $server = new \soap_server; $server->configureWSDL('server.hello', 'urn:server.hello');…
-
1
votes1
answer419
viewsPaging with Eager Loading in Laravel
I’m having a little ordering problem involving paging and Eager Loading. What I need to do: On one part of my site, I need to bring paged results from a subcategory The subcategory is daughter of a…
-
1
votes2
answers1059
viewsFor database abstraction, should I use uppercase or lowercase column names?
I am developing an application that will need to connect to any database. I am using Laravel for this. Laravel’s ORM maps the database fields and provides my class as an attribute automatically, but…
-
1
votes2
answers318
viewsPopulating database with Eloquent ORM
I have a database with some tables already populated, but now I have to popular the tables that have foreign key, I’m trying so: $tamanho = Tamanho::find(2); $genero = Genero::find(1); $categoria =…
-
1
votes1
answer476
viewsMultiple POST Optimization via Ajax
I have a small application, and I built it as I got to know Laravel, so nowadays there are things that I see are wrong and I try to adapt to good programming practices and one of the key points are…
-
1
votes1
answer437
viewsError saving form data to different tables
I have two tables Entries and Company that have relationship from 1 to 1 I have a form that the user selects if it is pf or pj, if it is pj opens the options to save the company. However, when I…
-
1
votes2
answers286
viewsWhat’s the convention on the location of the Laravel 4?
My question relates to the following: public function getIndex() { $users = \User::all(); return \View::make('admin.users.index') ->with('title', 'Usuários') ->with('users', $users); } In this…
-
1
votes1
answer530
viewsMaking exceptions in the Eloquent ORM Observers
I have the following code in my model: public static function boot(){ parent::boot(); // Não deixa excluir caso possua registros vinculados. static::deleting(function($content_area){ if($total =…
-
1
votes3
answers790
viewsImage upload problem Laravel/Intervention
I have a problem when I try to upload an image, well, when I give Submit in the form it returns the following error: Intervention\Image\Exception\NotWritableException Can't write image data to path…
-
1
votes1
answer294
viewsSearch for cross-results in related tables
I created several tables: Users: chave primária email senha Physical Detail: user_id altura Personal Data: user_id estado_civil Now I’m having a hard time getting mixed results. Example: find users…
-
1
votes1
answer1408
viewsPagination View return from Laravel/Paginate Array::make()
When I create a pagination manually, it is giving error, it does not create in the view the amount of exact elements as I determine. On my controller: public function getIndex(){ $fileClass =…
-
1
votes0
answers253
viewsProblems with Oracle Insert with Laravel
I’m having a problem with a INSERT in Oracle used the package yajra/Aravel-oci8, where the following error returns to me: Error Code : 1722 Error Message : ORA-01722: Invalid Number Position : 260…
-
1
votes1
answer890
viewsError in Laravel after inserting save()
Good afternoon I am trying at all costs to make an Internet in the bank, using the Laravel and Controller, however, it does not work at all, I have tried everything that is way, migrating, changing…
-
1
votes1
answer558
viewsHow do I translate to en-BR?
I have a form with following code: {{ Form::selectMonth('month') }} this returns me the months in English, how do I translate his return to Portuguese?
-
1
votes2
answers97
viewsCreate user with encrypted password
I have doubts about Laravel one of which is reflected where to insert the field: $password = hash::make('password'); Since I want to encrypt the password of the user creation form. The code of View…
-
1
votes3
answers9425
viewsEloquent with does not Inner Join?
I remember in the old days "discovering" that in a query using Eloquent, if I used the with Laravel made a inner join. Today by chance I went to check the queries of a project and... [2014-11-20…
-
1
votes1
answer161
viewsHow to concatenate value into a dropdownlist in Laravel 5?
How to add the first default value to a dropdownlist? I tried to do this way: {!! Form::select('Usuario.est_id',array('null' => 'Selecione') + $estados, null, ['class' => 'form-control']) !!}…
-
1
votes1
answer249
viewsGroups of routes with default values in Laravel
I need to understand how I create routes with default values (it would be the default that we have in function switch PHP). I’m looking for something like: Route::group(['prefix' => '/'], ['as'…
-
1
votes1
answer320
viewsMiddleware for routing authentication to an existing vector in Laravel
I’m starting to understand Laravel’s routing system now, and I’ve come up with a question regarding the Middleware. Can I have two equal routings for the same vector where when my user is…
-
1
votes1
answer784
viewsHow to delete all records of a belongsToMany
In the Laravel, when we have a relationship many for many, we have a method called attach and detach The attach adds entry into a relationship n:n, and the detach remove them. In both cases, these…
-
1
votes2
answers4659
viewsLaravel update via Composer
[Runtimeexception] Error Output: PHP Warning: PHP Startup: Unable to load Dynamic library /usr/lib/php5/20121212+lfs/Curl.so' - /usr/lib/i386-linux-gnu/libgssapi.so. 3: Symbol…
-
1
votes2
answers46
viewsselect com datetime mssql
I’m trying to select in ms sql but I can’t use datetime. $dataInicio = \DateTime::createFromFormat('d/m/Y', $input['data_inicio'])->format('Y-m-d'); $result = \DB::select('Select * from PESAGEM…
-
1
votes2
answers1023
viewsRoute Post is not being recognized (Laravel)
Good, I’m still new to using the Laravel 5, but I have a problem of Routes that I can not find solution anywhere (just the same problem Here and with no viable solution) Let me explain, in the…
-
1
votes2
answers599
viewsLaravel - FPDF error: Undefined font
What am I doing I’m rewriting a small barcode generation system using Laravel. What went wrong I’m instantiating the classes normally, but when I use the method…
-
1
votes2
answers2151
viewsPublish Laravel 5 in a subfolder
I need to publish a system I made using Laravel 5 for my client, however, I only have access to FTP. I installed Laravel via Poser on my localhost, it works very well, but I do not know how to put…
laravelasked 9 years, 1 month ago Daniel Swater 1,251 -
1
votes1
answer1862
viewsLaravel - Blank canvas
What I need I want to check if a blank Laravel project is working properly on the development server, IE, I just want to see if at least it loads the view, and then I’ll do some tests. What I did I…
-
1
votes1
answer94
viewsMake changes to a website developed in Laravel 4.2
I am starting development in Laravel and I have to implement new features on a site developed in Laravel 4.2 and by another programmer. I need to create a function that adds lines to a Log-style…
-
1
votes2
answers1147
viewsRelationship One for An Laravel
Good morning, I’m developing my first project in Lisbon, and I’m having a hard time in the relationship of two entities. I have my student registration, but I’m not able to understand how to call…
laravelasked 9 years ago Bruno Martins 11 -
1
votes1
answer355
viewsSlug and Post/Get on the same Route - Laravel
# PÁGINA DE PRODUTO - RELACIONADA AO CARRINHO Route::get('produtos/{slug?}', 'ProdutoController@getIndex'); Route::controller('produtos', 'ProdutoController'); My current code is above and is…
-
1
votes1
answer133
viewsRoute Error Accessing Site
When I add this route to the file Routes.php: Routes.php Route::get('postagem', function (){ return "teste"; }); Route::get('/', function(){ return View::make('hello'); }); Presents this error:…
-
1
votes1
answer267
viewsWhole data not saved in table as the Eloquent of Laravel 5
I have in my database a column called permission that dictates the permissions of users on my system. User 1 is administrator and user 0 is not. The problem is that when I save a new user and select…