Most voted "laravel-4" questions
Laravel is an open-source framework for developing web applications and services with PHP. Use this tag for specific questions about Laravel 4.
Learn more…141 questions
Sort by count of
-
3
votes1
answer120
viewsDoubt with Routes and Controllers Laravel 4
I’m a beginner in Laravel and I’m having a problem with routes and controllers. I created a form with the following action: {{ Form::open(array('action' => 'MatriculasController@formulario' }} I…
-
3
votes1
answer985
viewsDowngrade of package in Laravel
I’m facing a problem to run the composer install due to a package that is incompatible with the version of the Laravel that I currently use; The version I have is 4.1 with php 5.6, but when I run…
-
3
votes3
answers310
viewsAdd variables to Auth 4.2
I have my Auth session, which returns user data: print_r(Auth::user()); In this section, I want to add the company data associated with the user. In my model User, added the following: public…
-
2
votes2
answers1138
viewsImplementation Angularjs consuming data provided from Laravel using CORS
I’m trying to create a web service in Laravel 4, which will be consumed by a mobile app using Angularjs. When I make AJAX requests with Angularjs, it gives Cross Domain error by being in another…
-
2
votes3
answers2387
viewsUser-friendly URL for GET (search) form in Laravel 4
My question is this:: I have a search form (GET), and would like to know how when running Submit send these parameters to the URL in a friendly way. Obs.: parameters are not mandatory. Form: {{…
php laravel-4 laravel laravel-routes friendly-urlasked 10 years, 11 months ago Patrick Maciel 2,281 -
2
votes2
answers317
viewsProblem with Seed Relationship between Category and Sub-Category in Laravel 4
I don’t know how I do with my Seeds, I have 2 entities: Category and Sub-category. I want to be able to rotate Seeds and be able to register my Categories and after my Sub-categories, only that…
-
2
votes1
answer1006
viewsHow do I use DOMPDF in Laravel 4 in conjunction with a BLADE view?
I need to generate PDF report in Laravel 4. I have found several alternatives and I am in doubt about which best option: DOMPDF (alternate link) It seems very easy to use, since it’s our good old…
-
2
votes1
answer428
viewsRoute error not defined in Orange 4
I’m having trouble with a link I created in a view directing to a route. Follow the error: Errorexception Route [/user/addUser] not defined .(View:…
-
2
votes1
answer414
viewsInstallation of Laravel 4 on remote server
How to install Laravel 4 on a remote server via Composer? I searched extensively on the internet and found no convincing response that was in line with best practices or the philosophy of the…
-
2
votes1
answer224
viewsMy site loads different pages on different Operating Systems
I’m going through a very strange problem. When using Windows (Windows 7), my page loads as expected: @extends + index.php Already on Linux (Ubuntu 13.10) it is redirecting me to the route…
-
2
votes1
answer75
viewsIn Laravel, which file is indicated to use Macrotraits?
In Laravel, some classes use the trait MacroableTrait. Through this trait it is possible to create definitions such as: HTML::macro('urlQuery', function () { // Faça alguma coisa aqui });…
-
2
votes2
answers108
viewsWhat is the "array" option for in the app/config/Session.php?
I know that in Laravel 4 we can configure various ways to save session data. These are optional session storage mechanisms. Among them we can select memcached, database, cookie, apc and file, which…
-
2
votes1
answer159
viewsHow to define routes in Laravel that only work in a development environment?
I would like to know how to define routes in Laravel that work only in development environment. I believe that this can be useful to facilitate the debugs. I want to be able to separate some routes…
-
2
votes1
answer207
viewsLaravel 4.2 - 405 Method Not Allowed
I have a route that was working normally and stopped working for no apparent reason. It has the following configuration: Route::put('/clientes', 'Clientes@update'); The mistake I get is: Method Not…
-
2
votes3
answers1570
viewsLaravel Log In Error
I’m having trouble logging in Laravel. See, it does not log the user, but also does not return error: auth.php return array( 'driver' => 'eloquent', 'model' => 'Cliente', 'table' =>…
-
2
votes1
answer5625
viewsCreating Foreign Keys by Migration - Laravel
I’m having trouble when I try to create foreign keys by Migration in Laravel. Watch my Migration!!! <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint;…
-
2
votes1
answer353
viewsIs there any way to run Laravel on the command line in interactive mode?
In PHP, I know it is possible to rotate it interactively on the command line, which is via the command php -a. Even better would be using the library psysh. But when it comes to not just running…
-
2
votes2
answers1415
viewsLaravel - Update all fields from a large table
I have the following problem... I am migrating a system, and in the same I own a client table This table has a field called "cli_password", in which the customer’s password To use Laravel…
-
2
votes1
answer297
viewsView PDF after AJAX call with TCPDF in Laravel 4
After I save information in the database using the following code. $this->anamnese->create($input); I just call to test a code to generate a test PDF with the following code.…
-
2
votes1
answer278
viewsHow to update the pivot in LARAVEL 4 using the UPDATE method?
I have two models that are linked, through the belongsToMany, a relationship table N:N. So the structure is arranged as follows: class Permissao extends Eloquent{ public function niveis() { return…
-
2
votes3
answers1906
viewsHow to find the Laravel base url?
I remember that when I used the Codeigniter framework, I could find out what the base url of the application was by simply calling base_url(). On Laravel 3, I wore URL::base(). But now, on the…
-
2
votes1
answer232
viewsWhy should I use File::copy, if PHP already has copy?
I am using the Laravel in various projects that I use. I needed to copy a particular file from one location to another, and I saw in the Laravel documentation that I should use File::copy(). Out of…
-
2
votes1
answer106
viewsHow do I use the same app/config/local/database.php configuration when I’m running in enviroment "testing"?
In the Laravel 4, we have three types of environments that can be defined: local, production and testing. I even published something related to the configuration of the environment local here in :…
-
2
votes1
answer246
viewsIs there any way to configure Laravel 4 to use namespaces?
In the Laravel 5, I noticed that they have now added namespaces in the application folder. But things weren’t like that in the version Laravel 4. In the Laravel 5, for example the Controllers would…
-
2
votes1
answer56
viewstrashed() returning 'true' after Store()?
I have a model Manifestation using SoftDeletingTrait to keep them inactive in the bank and in the ManifestationController I have the following method destroy(): $manifestation =…
-
2
votes1
answer318
viewsIs there any way to generate Migrations based on an existing database in Laravel?
When I used Python’s Django, I was surprised by the command inspectdb, that is able to generate models based on an existing database. At Laravel, we have Migrations to work with the database, and I…
-
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
votes1
answer165
viewsExceptioncontroller error on Laravel 4 route
I set a route Restore in my file Routes.php <?php Route::model('user', 'User'); Route::model('comment', 'Comment'); Route::model('post', 'Post'); Route::model('role', 'Role');…
-
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
answers1449
viewsQuery in related tables
How would be an example of a bd query with related tables and an insertion of data in them. I have the tables : Produtos Tamanhos Generos I need to display in the view produtos.blade.php a list of…
-
1
votes2
answers1924
viewsWeb Service Nusoap Return Error
I’m developing a web service with Nusoap on Laravel 4. The class I’m wearing is the https://github.com/noiselabs/NoiselabsNuSOAPBundle Server Route::any('ws/server', function() { $server = new…
-
1
votes1
answer217
viewsHow to organize a 4 Standard Project
I’m starting now with Laravel 4 and would like to know how you organize your project? referring to controller and model classes. For example, in my case I will have an administrative area and I will…
-
1
votes2
answers330
viewsClass not found, but in another project worked
I had already inserted the Class Agent in another project using the Laravel 4, everything was working correctly, but now that I’m trying to put in another project the Laravel is returning the error:…
-
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
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
votes2
answers901
viewsTemplates for Laravel
I am starting a system that will be the basis of all systems in the company. The system will develop in Laravael 4 and the interface will be a theme of wrapbootstrap. What would be the best…
-
1
votes1
answer567
viewsTranslation Laravel 4
I did a search and found only one translation for PT (Portuguese - Portugal), there is some project or package for translation of errors and related ?
-
1
votes2
answers141
viewsError making a Post
I am trying to save the information that comes from my registration form with this function: public function postCreate() { $this->beforeFilter('csf', array('on' => 'post')); $validator =…
-
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
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
answer385
viewsBroken image - Laravel 4
I have an image on a page, inserted as follows: <img src="img/logo.png"> The image usually appears on pages with an address /page . But when the URL is in format /page/sub-plant the image…
-
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
votes2
answers273
viewsI can’t access the other urls of the project
I’m migrating to linux and I’m having a hard time, I installed php, apache, mysql and Composer, I can create projects all blz I had a great help until I reached it all. The problem is when I try to…
-
1
votes2
answers2281
viewsHow to list routes in Laravel (No Artisan)?
In the Laravel 4 i know how to list all routes through the command line. Just do php artisan routes. However, now, I have need to do this in the source code of my application. That is, I need to…
-
1
votes2
answers601
viewsIs there an Laravel Blade Statement Tag (instead of just printing)?
I was wondering if there’s any way to create expressions with Blade’s tags Laravel. I mean, the same way we use {{ $valor }} to be able to print something, it would be possible to use the Blade…
-
1
votes1
answer183
viewsHow to return difference after running update on Laravel 4?
Can anyone tell me how to return only the changed fields and values in an update to the Standard? ex: a table containing a name field with value John, let’s assume that I change this field to John…
-
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
votes0
answers97
viewsIn Laravel 4, how do I convert the Model output to XML?
In Laravel, how could I transform the following result below to an XML structure? $usuarios = Usuario::with('nivel')->where(['status' => 1])->get()->toArray(); // Resultado: [ 'usuarios'…