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
-
0
votes1
answer477
viewsDownload Image via Ajax + Laravel
I am trying to make a script for Download Images, by Ajax. It can be one or several. As you can see in JS, it has a function each searching for the selected images in the system. Then, I call Ajax…
-
0
votes1
answer136
viewsHow to implement multiple authentication drivers
I am building a system where it is necessary to have two types of authentication, the first referring to ordinary users, who will access the front of the store, and the second for administrators,…
-
0
votes1
answer1537
viewsRemove public from URL - Laravel
I’m accessing my website like this: http://localhost/site/public I’d like to just type http://localhost/site because I want it to work when I put it in the domain too. Is there any way to resolve…
-
0
votes1
answer214
viewsCall to Undefined method Memberstatus::all()
After creating a model, usually one of them has presented this problem: Symfony Component Debug Exception Fatalerrorexception (E_UNKNOWN) Call to Undefined method Memberstatus::all() The table in…
-
0
votes1
answer58
viewsError in facebook library. "Malformed access token"
I am trying to get the contact information of the facebook user. For this I am using the Facebook PHP SDK. I can generate the login url correctly. However, when I try to get the information I get…
-
0
votes1
answer194
viewsSet custom database settings in Laravel
My situation is as follows, I have several settings with the database set in the file databade.php, so far so good. But there are some connections that need data 'variables', such as the name of the…
-
0
votes1
answer2825
viewsquery between 2 tables
I have the product tables(tbl_products) and the categories table(tbl_categories): - tbl_produtos - id_produto nome id_categoria - tbl_categorias - id_categoria nome What I want is to present in the…
-
0
votes2
answers2260
viewsFill div with ajax result
I have an ajax request with the following code: <script type="text/javascript"> function AddVoto() { $.ajax({ type: "POST", url: "{{url('votos/adicionar/')}}/{{{$postagem->id_postagem}}}",…
-
0
votes1
answer219
viewsLaravel 5: crontab -e command does not work
Good afternoon, I created a command in the Laravel to make a cronjob function, the next step would be to edit the cron file with the following command: crontab -e Then insert the line: * * * * * php…
-
0
votes1
answer426
viewsHow to reconfigure APP_KEY from an Laravel 5.1 application
Today I restored my Macbook Pro because I had some incompatibilities with the El Capitan (beta). During this process I forgot to backup the file .env of my project, so I could no longer login to the…
-
0
votes0
answers38
viewsCommit only at the end of the registration stages
I want to register that will have several forms, for example: first I will register basic information, to advance register more advanced information according to what was passed in the 1st phase of…
-
0
votes1
answer253
viewsSybase 15 and Laravel 5.1 via ODBC and Error 3811
I have a database in Sybase (Adaptive Server Enterprise) and we started using the Laravel framework to transfer existing systems to it (a migration in BD cannot be contemplated). Laravel by default…
-
0
votes0
answers159
viewsHow to do LDAP authentication on Laravel
Good morning I need to change the authentication method from Laravel to LDAP in my company, but I have no idea where and how to proceed with the changes. I did some research and couldn’t find…
-
0
votes1
answer1150
viewsMigration change only the default value of a field - Laravel
I want to launch a migration that updates only the default value of a field, I tried it as follows : $table->string('mikrotik_rate_limit')->default('1048576/1048576');…
-
0
votes1
answer72
viewsError running Gulp --Production Vagrant Laravel/Homestead
I set up an environment laravel/homestead to study the Laravel 5.1 , when trying to execute the command gulp --production get the error below: Error: Cannot find module 'strip-bom' at…
-
0
votes1
answer856
viewsFilter a query using an attribute in Laravel
I have, briefly, the following structure:: Suppliers: id | cnpj | razao_social | endereco_id People: id | nome | tipo_pessoa | fornecedor_id Addressee: id | logradouro | cep Model - Supplier: public…
-
0
votes2
answers2205
viewsNothing to migrate
Hello, I’m starting in php plus the Laravel framework, and my doubt is about the command php artisan migrate to migrate a table in the database. When I executed the command for the first time it…
-
0
votes1
answer906
viewsHow to escape a javascript variable to the Laravel Slide?
Hello, I have this javascript function that receives a parameter: function teste(id){ document.getElementById("campo1").innerHTML = id; document.getElementById("campo2").innerHTML =…
-
0
votes1
answer4772
viewsCreate session variable when logging in - Laravel
Good morning, I’m going through a site made in Laravel, which I didn’t do. I need to do the following: When the user logs in, I want to take a specific value ("idLoja" column) from that user in the…
-
0
votes1
answer171
viewsWhat is the most performative way to group data from a PHP array?
I have an array that was generated by Database Query Builder of Laravel 5.1.x. array:96 [▼ 0 => {#1256 ▼ +"customer_id": 58 +"city": "Rio de Janeiro" +"program_id": 3 +"program": "PROGRAMA XPTO"…
-
0
votes1
answer1650
viewsMulti languages in Laravel 5
I am developing a project in Laravel 5, but I would like it to be in several languages. The language change would be by clicking on the link of each language and automatically translating the site…
laravelasked 8 years, 8 months ago Francisco Bizi 119 -
0
votes1
answer390
viewsRoutes Laravel / Angular $routeProvider
I have something like this in my app.js: app.config( function( $routeProvider ) { $routeProvider.when('evento/:id/:caminho', { templateUrl: 'views/evento.html', controller:…
-
0
votes0
answers121
viewsTroubles Homestead Laravel
Hello, when trying to give command in the Vagrant terminal up inside my Homestead folder the following error appears: /home/brendol/Homestead/scripts/homestead.rb:91:in `read': No such file or…
-
0
votes1
answer70
viewsHow to generate random names for images that will be uploaded?
I’m having trouble creating random names for my images. It was using the md5(mt_rand(1,10000) function but was unsuccessful using it in conjunction with has::file. public function anexar () {…
-
0
votes2
answers1493
viewsHow to Validate Only Jpeg as File Upload Extension?
I’m a beginner in programming. public function upload(){ if(Input::hasFile('file')){ $novonome = uniqid() . '.jpeg'; $file = Input::file('file'); $file->move('uploads',$novonome); return 'Anexado…
-
0
votes2
answers84
viewsPoint and Comma ';' beginning of the Laravel page
Hello, I am developing a project with Laravel 5.1 and I have a problem related to a sign ';' at the beginning of the page. I’ve already deleted all the code from the default layout, that is, without…
-
0
votes2
answers431
viewsCreating a website and back-end with PHP frameworks
I’m creating a website with back-end system. I have always done this process using only a framework like Laravel or Codeigniter, but talking to some people more experienced in this subject,…
-
0
votes2
answers1625
viewsHow to know the current route on Laravel 4?
In Laravel 5, we can take the current route (I mean the class instance) using the class Illuminate\Http\Request, through the method route. Thus: public function handle(Request $request) { $rota =…
-
0
votes2
answers94
viewsSave Related Models (One to One) - Laravel 5.1
I have a Model Info and a Model Complement that are related one to one. The relationships are already working properly, I can pull the data and such, but I need to do an update and do not know how.…
-
0
votes1
answer188
viewsWhat is the "url" option in the app/config/app.php configuration file.
In the Laravel 4, we have a configuration file app/config/app.php. There is an option called url. Many times I’ve seen this empty option: 'url' => '', And I also did the test to put some url…
-
0
votes2
answers1524
viewsHTACCESS URL rewriting by ignoring existing files and folders
When I go to pass a site in the server I put a file .htaccess with this code below: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule> This code…
-
0
votes2
answers555
viewsController pulling database data from wrong place
I have the application properly configured and running normally. But one detail is jamming. This is my file . env: APP_ENV=local APP_DEBUG=true APP_KEY=9FaEj6iJCBur1favtWQ88b8m1anbGbzP…
-
0
votes2
answers694
viewsSidebar via Controller - Laravel 5.1 + Adminlte 2
Good afternoon! I have the following problem here... In my view model app.blade.php have the line @include('partials.sidebar') which includes my sidebar, okay. The point is that I have 2 different…
-
0
votes1
answer1903
viewspgsql connection problems in Laravel 5.1
I am trying to connect to the pgsql database by Laravel 5.1 but an error is appearing: Pdoexception in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using…
-
0
votes1
answer1506
viewsNot found class in Controller
The model only gives NOT FOUND in a controller that manages News. ERROR: Fatal error: Class 'App Models Site Noticiamodel' not found in C: xampp htdocs Managercontent App Controllers Site…
-
0
votes1
answer1233
viewsDocument root Apache 2 cannot find routes from the Apache
Assuming we are on a linux server we have the following password. the root Document pointed to <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/laravel/public…
-
0
votes1
answer769
viewsHow to change the Auth database of Laravel 4.2?
My project has two databases: one for the user account and another for the project domain. My need is to define the database that the Auth uses for authentication, because in the default…
-
0
votes1
answer26
viewsFilter 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…
-
0
votes0
answers8142
viewsLaravel date in full in English
I’m using Laravel 5.2 and would like to bring the dates in full in Portuguese (pt_BR), but Carbon brings the dates text only in English. $post->created_at->formatLocalized('%B'); //"January"…
-
0
votes1
answer174
viewsEloquent giving error 500 with many results
I’m performing a query in my base with some LEFT JOIN and some WHERE clauses, however, I’m having a lot of difficulties with the return of this query that, for having many results, simply after a…
-
0
votes0
answers96
viewsSlow to load Mongo image with PHP
I am developing a system that uses Mysql as a database and Mongo BD for image storage. The problem is that the images loading is very slow. OBS: I am using Laravel 5.2. Function that loads image:…
-
0
votes4
answers989
viewsReturn data from a URL with Query String
There is a service that needs to send data via query string and it gives me a JSON return, however, I am not getting this return, it does not send the query string. $url =…
-
0
votes0
answers813
viewsHow to build an Object with an Array inside, using Eloquent Laravel
Hello folks I need to build a array as follows for a plugin: var data = [{ "label": "Follows", "color": "#aad874", "data": [ ["Seg", 50], ["Ter", 84], ["Qua", 52], ["Qui", 88], ["Sex", 69], ["Sab",…
-
0
votes0
answers284
viewsRoute post ajax Laravel
Galera I have a search field by ajax in Aravel that works normally local but on the server it is returning error. When the search route (post ->…
-
0
votes2
answers1908
viewsAdapting Code to Laravel , CEP Automatic Fill
Hello, I’m trying to adapt the code of this link: http://www.rafaelwendel.com/2012/08/preenchimento-automatico-do-endereco-a-partir-do-cep/ for Laravel 5.2, unsuccessfully. It works well without the…
-
0
votes1
answer139
viewsIdea of Event in the Laravel
I’m developing a system in Laravel(php). I read in several articles that "we should" use "EVENTS" to perform actions after the main one has been done, for example: -> in the controller: // I…
-
0
votes2
answers1269
viewsHow can I treat Violation Constraint exception to show the user in a user friendly way
How best to treat a Integrity Constraint Violation exception to explain user-friendly ?
-
0
votes0
answers683
viewsHow to record and display images using Postgresql and Laravel 5.1
I have the following code in my Controller to save the image in the database, not any error so I think it works right. $data = Input::file('assinatura'); $escaped = bin2hex($data);…
-
0
votes1
answer289
viewsField return in Laravel
I have the following field stored in my database: When trying to return it in view by Laravel 5.2 he is returning only the 45 the rest is not. the field is defined this way in the bank: But other…
-
0
votes1
answer1030
viewsComposer update problem - Laravel
Good afternoon to all I am trying to install a package by Composer on the Laravel, and by typing "Composer require Bert/ldap-Authenticator" it does the installation, but produces the following…