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 votes2 answers83 viewsTake All Records and Separate by StatusDealer.php class Dealer extends Model { # Relacionamento com Medalhas public function dealer_medalhas(){ return $this->hasMany('App\DealerMedal', 'id_concessionaria'); } } Dealermedal.php class… 
- 
		2 votes2 answers5344 viewsIs it possible to capture the current url in the Blade view?I would like to capture the example url, /user/** (everything that starts with /user), I am using Laravel and Blade, using Request::url() I get localhost:8000 but I need something that can capture… 
- 
		2 votes1 answer507 viewsProblem with . htaccess, subdomainI have on my site (root) a Windows installation, IE, in the public_html folder I have a file . htaccess with: <IfModule mod_deflate.c> <FilesMatch "\.(html|php|txt|xml|js|css)$">… 
- 
		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 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 answer198 viewsVersion control Rest with LaravelI’m doing an update on an app Android that has as back-end one api REST with php Laravel. I would like tips on how to do version control of this api. For example, I had to make a change to a table… 
- 
		2 votes1 answer173 viewsHow to Sort Related Model Data?I have the following relationship in my application: Model Client: class Cliente extends Model { protected $table = 'clientes'; public function Usuario(){ return… 
- 
		2 votes1 answer946 viewsCondition in request ConditionI have a request class called PessoaRequest. In this class, I validate my form to register people. But now, some information has appeared to be entered that are not mandatory: father’s and mother’s… 
- 
		2 votes1 answer107 viewsData sorting with phpI need to sort an array by a specific "order" field, where within that array I have banners objects with the id, order, name and img fields. I need to sort this array in order. the order banner 0… 
- 
		2 votes2 answers7856 viewsHow to get the GET value in Laravel, even when the request method is POST?I’m making a request for a route, where the request method is marked with the Any - that is, accepts any method. public function anyIndex() { $nome = Input::get('nome'); $id = Input::get('id'); //… laravelasked 9 years, 6 months ago Wallace Maxters 102,340
- 
		2 votes0 answers50 viewsProblem with Laravel Online applicationGuys, I upped my app Laravel Online and gave the following error: Fatalerrorexception in Authserviceprovider.php line 9: Class 'Illuminate Foundation Support Providers Authserviceprovider' not found… 
- 
		2 votes2 answers2923 viewsInstallation of the LaravelI followed the installation text of the Laravel that is on the official website and returned me the following errors. Warning: require(C: xampp htdocs primeiro_app_laravel… 
- 
		2 votes1 answer241 viewsHow 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… 
- 
		2 votes2 answers833 viewsFooter does not appear on the first page - Laravel DompdfI 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 answer1294 viewsHow to bring only the latest records with Laravel 5.2I need to return the last 10 records to a view.. return view('home.home', [ 'data' => $this->sale->get(), //aqui eu quero pegar os 10 últimos 'nav' => 'dashboard' ]); There’s some… 
- 
		2 votes1 answer217 viewsLaravel 5.2 $errors emptyI am using Laravel 5.2 and am trying to create a validation for user record. In Usercontroller.php I have: public function postSignUp(Request $request){ $this->validate($request, [ 'email' =>… 
- 
		2 votes1 answer899 viewsLaravel - Test script errors to return certain status to AJAXIn an application in Laravel I have several scripts using ajax. Everyone expects a response from the controller script and, if it returns true, I run a certain function with the 'Success' ajax… 
- 
		2 votes1 answer1880 viewsHow to pass data searched by a view back to the view itselfI need to search a database through a view (Laravel Blade). The data obtained, stored in an array, need to display on the page called the database. I am not succeeding in returning the array with… 
- 
		2 votes2 answers61 viewsDatabase overloads while deleting lines with relationships?Good afternoon to all! I have a question, and I’d like to get some opinions. I’m building a system in php + Larable. I have relationships between tables, for ex: Users->Roles. They are supposed… php database laravel table relationshipasked 9 years, 5 months ago Fernando Herique Rubim Pioli 285
- 
		2 votes2 answers92 viewsWhen using the Laravel view helper, what kind of data is being returned?I am doubtful when commenting on the method below: public function index() { $posts = Post::orderBy('created_at', 'desc')->paginate(10); return view('painel.post.listar', compact('posts')); } It… 
- 
		2 votes1 answer8769 viewsCreate/Modify table without deleting data Laravel MigrateI have a question about the Migrates. I am using Laravel 5.1 with Sqlite database. When I turn the remote php artisan migrate or php artisan migrate:refresh, generally to add new tables or insert… 
- 
		2 votes1 answer328 viewsInsert of data passing only $_POST using Laravelon the assumption that all names the inputs have the same name as the database column. public function create(){ // o que está abaixo é um exemplo com os dados já populados $arrayDados=… 
- 
		2 votes2 answers1150 viewsGroup items by month and count themI need to group and count all items by mês. Utilise Laravel 5.2, tried to do so: $mes = date('m'); $vendas = Encomenda::where('FlgStEncomenda', 'O') ->group("MONTH(created_at)={$mes}")… 
- 
		2 votes1 answer559 viewsLaravel - Not log in after registration....?How to remove automatic login after registering? I commented the following line from the Registerusers file: public function register(Request $request) { $validator =… 
- 
		2 votes1 answer772 viewsI can’t do Laravel Authentication 5.2I’ve been trying for some time to make an authentication and I can’t, I’m a beginner in the business, who is willing to help me know that you will be practically saving my life, because I’ve thought… 
- 
		2 votes2 answers3109 viewsMethodnotallowedhttpexception in Routecollection.php - Laravel 5.2Developing an application using Laravel 5.2, PHP7.0, Apache2 and Centos 7, I am having the following error: Methodnotallowedhttpexception. On the local server it works normally... when I publish on… 
- 
		2 votes1 answer722 viewsLaravel - How to call a different action from store,update, Edit?I created a action without being the standard of resource, how can I call the same for an action on form as I call the update and store. <form method="POST" role="form"… 
- 
		2 votes1 answer5249 viewsHow to use view variables in Laravel 5I am developing a project of "loans" of things of a company and I am locked in a module of keys. So I don’t have much experience in the Laravel, so I came across the following situation: Database -… 
- 
		2 votes1 answer5339 viewsPHP - How to configure . env from Laravel to access different databases and different languages?I am working on a system (portal) that offers service to 19 countries. For each country there is a database and each country with its language dictionary (even countries with the same language, have… 
- 
		2 votes1 answer32 viewsCan I use Laravel 5.3 in 5.2 projects?my note has broken and I am mounting the Vagrant virtualbox environment in another note. I was using Lavarel 5.2. Can I install version 5.3? Will I have any compatibility issues with my 5.2… 
- 
		2 votes1 answer515 viewsException Handler having return in JSONI’m building a Restapi using Laravel/Lumen, in tests can occur the return be totally in HTML, this occurs when it appears that already famous screen: Whoops looks like Something Went Wrong This gets… 
- 
		2 votes1 answer6290 viewsLaravel - Creating select with Form::select + Model::listsI’m trying to create a select with the following code: My controller is like this: public function create(){ $marcas = Marca::lists('descricao', 'id')->toArray(); return… 
- 
		2 votes1 answer430 viewsHow to run a Python Crawler with PHPI made a Crawler with Python and run it by command line: python crawler.py As soon as I execute this command he asks me for the keyword that will be searched and start running. global keyword… 
- 
		2 votes2 answers145 viewsLaravel Blade (Error While Displaying Text)Hello, I’m using Blade to show data, the q problem when using the functions ucwords and strtolower is not displayed. (without the right functions, but the text is ugly, or all uppercase, or… 
- 
		2 votes1 answer976 viewsProject copy without installation of Laravel FrameworkIs it possible to copy an Laravel project to a server without having to install Laravel on that server? Just copy the files or I have to make some additional configuration, besides pointing the DNS… 
- 
		2 votes1 answer582 viewsEnter and search data in the database per user with LaravelI need to save information in the database per logged-in user. That is, when the user logs in, everything he does will be saved in the database of that login. That is, when user X logs in,… 
- 
		2 votes1 answer62 viewsLaravel Queries SQL Doubt?I’m starting with the SQL of Laravel I searched much more I did not get an answer on how to make a AND after a where, follows example code to implement a AND. SQL: UPDATE contas SET valor_titulo =… 
- 
		2 votes3 answers2985 viewsDelete file LaravelWhen trying to delete an image from a specific directory I get the message that the file does not exist, but consulting the path that the code is running I see that the file does exist, and the path… 
- 
		2 votes3 answers2215 viewsbelongsToMany Laravel - find()I’m developing an Intranet that will contemplate Categories and Posts. A post can receive "n" categories. To that effect I’m using belongsToMany(). The problem is when returning this data with… 
- 
		2 votes2 answers374 viewsError installing Laravel phplegends/en-ValidatorWhen trying to install the en-Validator via Composer require laravellegends/en-Validator or even editing the Composer file manually I’m encountering the following error:… 
- 
		2 votes0 answers234 viewsHow to paginate a Javascript filter in Laravel 5.4?I created a search filter for a table, in it I have Description, Model, Status, among other 'inputs' to search. But after the search is done, the paging does not follow the result. Follow the code… 
- 
		2 votes1 answer363 viewsCheck route with variable on Laravel 5.1I 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… 
- 
		2 votes2 answers1283 viewsUser Registration in LaravelI’m starting with Laravel for a couple of weeks and automatically it’s raining with doubts. I have a registration form with the following button below: <button type="button" class="btn… 
- 
		2 votes1 answer463 viewsOptimize queries with leftJoin Laravel?I have linked tables and when I need to access the information I recreate the query: DB::table('paciente AS pac') ->leftJoin('pessoa AS p', 'p.id', '=', 'pac.id_pessoa') ->select('p.nome,… 
- 
		2 votes2 answers3637 viewsFilter records by month and year in LaravelI 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,… 
- 
		2 votes1 answer96 viewsList errors returned in an ajax requestI 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:… 
- 
		2 votes2 answers4790 viewsHow to go up and configure a project with Laravel on the serverI’m starting with Laravel 5.3 and learning to explore all of its resources. But I have a question. What would this project of mine look like on the server (in production). Today my projects are… 
- 
		2 votes2 answers1798 viewsHow to update the PHP version in Laravel?I tried to install a dependency and he asked for a larger version of PHP. Problem 1 Illuminate/support v5.3.4 requires php >=5.6.4 -> your PHP version (5.5.9) does not satisfy that… 
- 
		2 votes2 answers1580 viewsProblems with charset in the LaravelI have a database Firebird which was not built through migrations in the Laravel, and it has encoding ISO-8859-1 and I need to return an object in the format JSON for my application, however, in… 
- 
		2 votes0 answers238 viewsDoubts about Bradesco boleto integrationI’m having doubts about how to integrate this Bradesco payment solution. That’s the documentation I don’t know if it’s via POST, via GET, if it’s via XML. I’m confused.. I tried something like this…