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
-
1
votes2
answers400
viewsFiles . css should be in the /public or /Resources folder?
I wonder why Laravel 8 is built with the folder /css inside /resources and not within /public, as set out in documentation? Call from the css file Directory of the css file outworking <link…
-
1
votes1
answer77
viewsUpdate class data with Array in Laravel
I have to update several records in mysql database via ajax in Laravel. There is a list of many teachers with many subjects, however they are part of a class in specific. If anyone can help me very…
-
1
votes2
answers81
viewsAdd data from "pivot" table of relation Many to Many
I have 3 tables (clientes,seguradoras e clientes_seguradoras) that relate through 2 Models (Cliente e Seguradora) in Laravel Each customer can have several insurers, and for each insurer he can add…
-
1
votes1
answer21
viewsLaravel: Display Row() instead of result()
I’m wearing the Laravel 7.3. I have the following appointment: $data = DB::table(self::TABLE_CATEGORIES) ->select('id') ->where('slug', $slug) ->get(); And the result would be this:…
-
1
votes0
answers27
viewsConfirm deletion with Sweet alert2 and Laravel 7?
I have a button: <button class="btn-floating red btn-small" data-id="{{ $tag->id }}" data-action="{{url("/admin/tags/{$tag->id}") }}" onclick="deleteConfirmation({{$tag->id}})"> <i…
-
1
votes0
answers49
viewsInsertion of encrypted and related data into Laravel 7 database
Save, I need help. I am developing a system that has a user table and a table of enrollments. The registration data is related to the CPF registered in the Users table. The problem is that now I…
-
1
votes2
answers21
viewsLaravel , how to display image through class
How do I display an image through my css condigo? is that the theme I use the images as for example: the banners are displayed through the class in style.css , below is what would be done but do not…
-
1
votes0
answers172
viewsSyntax error or access Violation: 1066 Not Unique table/alias with polymorphic relationship in Laravel
I’ve been racking my brain for weeks and I can’t solve this problem. I’m using this package https://github.com/rappasoft/laravel-livewire-tables to use Datables in Laravel with Livewire. I have…
-
1
votes0
answers55
viewsSocial login using API in Laravel with Socialite to be consumed in an application in Flutter
I am developing an API using Laravel 5.8 to be consumed in a flutter application. So, I’m using Laravel Socialite to log in with Facebook and Google. However, I’m still new to these frameworks and I…
-
1
votes1
answer39
viewsHow to load an image dynamically in the Lockable navbar?
Hello, when adding a user to the system I am already loading his photo in the database and it is being stored in Storage/app/public/Employees/filename.extensao, I need this image to appear in the…
-
1
votes1
answer376
viewsTrying to get Property of non-object error while trying to access the Blade view in the Laravel
I am trying after a foreach to access the variable with the object array in the Slide but it displays the Trying to get Property of non-object error. I’ve tried with the "firt" but it only takes the…
-
1
votes1
answer212
viewsBy select value in a PHP variable: LARAVEL BLADE
I’m trying to get the value of select "Categories" and put in the variable "$article" using Laravel’s Slides, but I’m not finding how to do this. Someone can give me a light? <?php $categories =…
-
1
votes0
answers24
viewsSort object listing by relation Many-to-Many
OBJECTIVE: To order a list of eloquent entities based on a column of a Many-to-Many relationship. To create a system of favorite posts, I created a favorite_posts table that would be the link…
-
1
votes0
answers79
viewsExtender models of the setTable Passport does not work
I extended the 5 models of the Passport: I extended because I have to add Shema to the table name and for that I have used this function in the constructor of my other models: public function…
-
1
votes0
answers27
viewsDoubt Laravel Trait
Good staff , I have the following Trait in the Laravel <?php namespace App\Traits; trait Imageable { public function getUrlImageAttribute(): string { .... } } I use the same in the following…
-
1
votes0
answers45
viewsLaravel Excel maatwebsite validate spreadsheet before importing to database
I am trying to validate a spreadsheet before importing it to the database, I need to check if there is any date above today’s date in the file, but I can only check the first line and there may be…
-
0
votes2
answers1675
viewsPHP framework with greater similarity to Codeigniter?
Which of these frameworks below have greater similarity to Codeigniter, so I can have the smallest learning curve? Laravel Cakephp Zend
-
0
votes5
answers1939
viewsSending form via AJAX, method PUT
Problem: I am trying to send a form with ajax via PUT, but it is returning the following message on Chrome console: PUT http://intranet.dev/%7B%7B%20URL::to('upload/'.Auth::user()-%3Eid)%20%7D%7D…
-
0
votes1
answer100
viewsHow to change the required minimum password size
I am trying to change the minimum size for the field 'password' but I can’t find. Does anyone know the minimum amount that Laravel requires for this field and if it is possible to change? If so,…
-
0
votes2
answers1209
viewsHow to make a ternary relationship in Laravel?
What is the best way to make a ternary relationship in Laravel? I am doing a "multi client/company" application (type Basecamp) and the following relationship appeared: one user has a (0 .. n)…
-
0
votes2
answers666
viewsModel delete method does not erase record
I have the code below on the route, but it doesn’t work! What am I doing wrong? It is returning users correctly but doesn’t delete. $Usuario = User::find(2); $Usuario->delete(); return…
-
0
votes2
answers1110
viewsLaravel 4 (Eloquent) Error deleting records
Hello, in this code below I delete the database of the selected records in a list of chekboxes. I have an array of Ids that is mounted as follows: Array ( [0] => 810 [1] => 811 ) On top of…
-
0
votes2
answers856
viewsHow to deploy Laravel 4.2 applications via FTP?
Hello, I want to deploy an application in Laravel 4.2 via FTP, but the resources and tutorials I found could not solve the problem. Someone could show me a method?
-
0
votes1
answer760
viewsUncaught Referenceerror: CKEDITOR is not defined
I’m using the Ckeditor so that the user can fill in some texts. On the Home page of the site was looking at the Devtools of Chrome and found the mistake. Uncaught Referenceerror: CKEDITOR is not…
-
0
votes2
answers2536
viewsLaravel - Accessing absolute directory path for download
I created a directory within /public called /uploads/pdf. In this directory I keep PDF files from which I need to download. I created an AJAX request for this that calls an application controller…
-
0
votes1
answer155
viewsAllocation of responsibilities in the MVC
I’m starting work with MVC, more specifically with Laravel and Eloquent (the ORM embedded in Laravel). I have studied and continue to study the MVC standard and its advantages. However, in practice,…
-
0
votes1
answer131
viewsMore of a relationship in the same model
My client class has a relationship one-to-one with endereco and one-to-Many with contacts. How would be the functions in Cliente to function? and in Migrate?…
-
0
votes4
answers3795
viewsFilter results by logged-in user id
I am building a system using the Laravel framework (I have little knowledge in Fw) and I need to get the id of the user who logged in to make the queries based on the user id. Ex: User => lists…
laravelasked 10 years ago Tassiano Alencar 3 -
0
votes1
answer227
viewsHow to set HTML attribute with @Yield() in Laravel?
I’m trying to create a template for my control panel in Laravel. I want the top right corner to have a BACK button, where I can set the link with the @yield I tried to make the following code, but I…
-
0
votes2
answers343
viewsSecuring routes in Laravel 4
after logging in the user system I would theoretically have to have some protected routes, how do I do that? In my case is returning error. Look at: Routes.php Route::group(['before' =>…
-
0
votes1
answer357
viewsRun javascript function on AJAX calls to a specific page
I have a site in Laravel where the content is dynamically loaded with AJAX, IE, in each call Laravel returns only the view of the part I need, in a certain page I need to initialize a jQuery plugin…
-
0
votes0
answers225
viewsAccent error
I’m having a problem with Laravel’s coding. I have tried changing in php.ini(charset=ISO-8859-1). I’ve been in the script header.php file I’m using trying to change the charset and also could not.…
-
0
votes2
answers79
viewsHow to bring Model by IDS and sort at the same time
I am with the ids returned from an immense query to bring the posts with a search term... Already working bring the posts through the Model by the selected IDS but it always brings sorted by ID and…
-
0
votes0
answers80
viewsExtending the Filesystem class in Laravel 5
I’m having some problems with the Filesystem class. To solve my problem, I want to change the put() function of this: public function put($path, $contents, $lock = false) { return…
-
0
votes1
answer289
viewsEloquent + Object carrying itself
I’ve always used Eloquent very well with static methods. Yesterday, when creating a new concept of session registration for a new project, I came across a question that I could not clarify. I have a…
-
0
votes2
answers366
viewsHow to Overwrite an Image with DIV
Gentlemen, I’m pulling some images from the database, and when the user hovers over them an opaque red color will be above them, and a title and text will be shown. I did this by putting the image…
-
0
votes1
answer959
viewsEdit record in database
I’m trying to edit a form using fill()->save() but instead of updating Laravel 5 tries to do insert and gives error saying that the record already exists in the table. $input =…
-
0
votes1
answer1032
viewsPHP Artisan Make:Model Command Does Not Work
I’m using Composer to generate my PHP files and other things. I think it makes programming much easier. For example, to generate a Controller I do so: php artisan controller:make NomeController…
-
0
votes2
answers371
views"Controller method not found." in a method that exists
I’m starting with the Larable and on a project that was already underway. I’m trying to access the url http://mydomain.com.br/purchases/edit/1 and is always returning. Symfony Component Httpkernel…
laravelasked 10 years, 1 month ago Erlon Charles 5,352 -
0
votes2
answers398
viewsAlternatives to pass data through Hidden fields
I’m creating a system, where I always need my object id in the BD, and in most of the system I send this id from the VIEW pro controller using the Hidden fields with a POST. Speaking of security,…
-
0
votes2
answers353
views -
0
votes2
answers253
viewsGet counter of objects associated with Laravel 5.x
My model Project has n Pieces (which is also a template). I want to add a function or Lazy Property to know how many parts are associated with a given project. Grateful.…
-
0
votes1
answer361
viewsLaravel - How to make a Try/catch in the view?
Is there any way to make some try/catch in a view of Laravel 4? How could I implement in the syntax of blade? I’d like something like: @try <div class="laravel test"> {{ $usuario->nome }}…
-
0
votes2
answers267
viewsDelete method returns unencumbered page
I use the form below to send the id of the row to be deleted in the table: <form method="DELETE" action="{{ URL::to('receitas/delete') }}" > <input type="hidden" name="id" value="{{…
-
0
votes0
answers1190
viewsLaravel 5.1 localhost:8000 nothing appears
I installed the 'laravel 5.1' I followed the steps in doc, added some things in doc 'gulpfile.js' blz, but when I turn the 'php artisan serve' and whirlpool 'http://localhost:8000/' nothing appears,…
-
0
votes0
answers214
viewsHelp with Where in Laravel
Hi, guys wanted a little help from you on a Where. In my system is like this, I am in the Development photo gallery page( id=1 ), on this page I can register the photos of the month/year of the…
-
0
votes1
answer532
viewsDefault field to select in Illuminate/html
I have a problem and I have already searched the internet for the solution. Unsuccessful! I have a form and inside it, a select filled automatically: {!! Form::select('categoria_id', $categorias,…
-
0
votes1
answer501
viewsLaravel 5 - How to use Primary key in pivot table?
I have a question that came up now. You searched the forums, and I did not find anything like it. I have this scheme in my comic: users: id name ... products: id name ... product_user: id product_id…
-
0
votes2
answers1208
viewsImport library to Laravel 5
What I need I need to import the modified FPDF library to the project. What I did Code is below, but I created a folder "Libraries" inside "App" and put the library there (with the name FPDF.php),…
-
0
votes1
answer364
viewsCommand Laravel
I have a Queue class in Laravel 5.1 that does an insertion in mysql through a csv, but I can’t use Session in this class and I can’t even get the id of the user logged in by oauth 2. How can I do…