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
votes1
answer1144
viewsSend . pdf, in Base64, by e-mail
I get a string through a API external, which comes directly from the client (I only take care of the website, making it impossible to change the type of information I receive). This string is a .pdf…
-
1
votes1
answer2148
views -
1
votes2
answers1527
viewsHow to treat Queryexception SQLSTATE error[23000]: Integrity Constraint Violation: 1062 Duplicate;
The id is auto increment, but the id_uc is Unique, just not to enter an identical id_uc. I want you to return to view a message. $storm =new ListaStorm(); $storm->id = $id; $storm->id_uc =…
-
1
votes1
answer211
viewsSet sender name via Resetpasswordnotification
I am using Notification in Laravel to send password reset emails. My toMail method is like this: public function toMail($notifiable) { return (new MailMessage) ->subject('Link para redefinição de…
laravelasked 7 years ago Fábio Jânio 3,407 -
1
votes1
answer978
viewsLaravel update type error
Is appearing the error: Type error: Argument 1 passed to Illuminate Database Eloquent Model::update() must be of the type array, Object Given, called in…
-
1
votes0
answers179
viewsPagseguro and Pagseguroconfigwrapper
I am working with Pagseguro in Laravel 5.3, the problem is the Class Pagseguroconfigwrapper that I need to generate to make the authentication, i do all the steps described in the documentation and…
-
1
votes1
answer680
viewsRedirect Route direct to view
I’ve read in some places that the correct thing is to point the way to a controller and then redirect to a view. I do it even when I won’t pass any variable to that view? In that case, I will have a…
-
1
votes1
answer1707
viewsHow to solve css loading problem and js Ready to work?
When I run my local application, the styles and js are loaded normally. The css and js are in public/css and public/js. In production they are not loaded, below the production . htaccess:…
-
1
votes1
answer81
viewsHow do I send email via E-mail?
I have the following routine implemented in Laravel $prestadores = \App\Prestador::all(); Mail::send('emails.listaprestadores',['prestadores' => $prestadores], function($message) use…
-
1
votes1
answer522
viewsDoes anyone have any idea how to create a pagination with RESTFULL API in Laravel?
Could someone give me an example of how to do this and JQUERY build paging? Even if it’s some tutorial. I have already searched several places and all say the same thing to create a pagination in…
-
1
votes1
answer1235
viewsHow to create an array dynamically in PHP?
I need to create an array in the format: //$arr = ['id' => 1, 'razao_social' => 'Teste'] // saida esperada // iteração foreach($prestadores as $prestador){ // logica separando apenas alguns…
-
1
votes1
answer297
viewsHow to hide fields in queries using eloquent Join method
From a question, I was given a way to make queries with children objects using the Join of the eloquent, The query is below: $dados = Roda::join('veiculos', function($query) {…
-
1
votes1
answer2006
viewsHow to get all users currently logged in to Laravel 5.4
I need to loop all users who are currently logged in to the system. How could I do that? I know with auth()->check() we can know if a user is logged in. More I wanted to know of everyone who is…
-
1
votes3
answers1096
viewsHow to find out the PHP version of a standard project?
To find out the php version of the Laravel project, have some command in cmd?
-
1
votes1
answer544
viewsHow to perform a double consultation in the Standard?
I have a query in SQL Ansi: select * from payments as P, receipts as R where P.created_at < CURRENT_DATE AND P.updated_at < CURRENT_DATE AND R.created_at < CURRENT_DATE AND R.updated_at…
-
1
votes1
answer378
viewsError: Array to string Conversion - Select Multiple Laravel 5
In my View I have: <select multiple="multiple" name="carga_mental[]" class="form-control select2"> @foreach($cadastros->where('key', 'carga_mental') as $carga_mental) <option value="{{…
-
1
votes0
answers106
viewsProblems with Vue in an Laravel project
This is my project. http://laravel-vue-axios.herokuapp.com/ He is able to save, delete and edit, but when I do the actions I cannot perform the automatic refresh in the browser, I don’t even know…
-
1
votes1
answer195
viewsUpload Laravel + Vue.js
I need to upload some files, but there is a detail, will be mounted a table as in the figure below, I can already add in the table itself, but at the time of the upload I do not have the slightest…
-
1
votes1
answer65
viewsMysql Error - Stored Procedures
I am creating this process to run once a day, as I have no experience, I got an error in the code below: CREATE (definer omitido) PROCEDURE `MULTAOFF`() BEGIN set @multado = (select `CPFAluno` from…
-
1
votes1
answer268
viewsProblems deleting via ajax with Laravel
I’m having trouble effecting a deletion with Laravel 5.3. By submitting the ajax it simply is not returning me anything. Man JavaScript is like this: $.ajaxSetup({ headers: { 'csrftoken' : '{{…
-
1
votes1
answer4106
viewsTarget [Repository] is not instantiable while building [Controller, Service]
I’m developing a system that when sending data by form is returning me that error: Bindingresolutionexception in Container.php line 763: Target [Church Repositories Membrorepository] is not…
-
1
votes1
answer31
viewsMiddleware for post handling
I created a middleware to check if the person who wants to manipulate a post owns this one or if it’s the super admin. Behold: public function handle($request, Closure $next) { $user =…
laravelasked 7 years, 10 months ago Fábio Jânio 3,407 -
1
votes0
answers69
viewsLaravel Form Validation Reload F5
I have the following doubt: Once I make the Submit of a form it makes the validation right, but if I give F5 in the browser it disappears with the error messages and also add the values of the…
-
1
votes1
answer422
viewsORDER BY in string date
I have a table in the database, novidades, where I have a column with the name date is being stored as a string in the format dd-mm-yyyy, but I would like to sort by date based on this value, I…
-
1
votes0
answers72
viewsLaravel 5.3 Route does not accept parameters other than "/"
Good morning. I’m new to Standard and installed 5.3 with php 5.6. When I started defining the routes I came across the situation of that method Route::get() in the first argument only accepts "/".…
-
1
votes0
answers29
viewsRoute to Many-to-Many relationship
I have a related REST API question, if anyone can help, thank you very much. I have two entities, Product and Store, which has a Many-to-Many relationship between them. A Product may be available in…
-
1
votes0
answers2258
viewsAPI for barcode query
I’m negotiating with a company a software to be developed, among the needs arose the registration of the product quickly without needing many user entries. Therefore I had the idea of maybe getting…
-
1
votes1
answer5387
viewsHow to use hasmany relationship in Laravel 5.2?
I have 3 tables of funcionário, apontamentos and horastrabalhadas. My relationship is hasmany 1 employee has several apontamentos. When I show the result with a dd() comes the employee data twice…
-
1
votes1
answer1475
viewsHow do I pass an array of data to a readable view?
How I pass a result from a select to a view? public function index() { $equipams = DB::table('equipamentos') ->select('equipamentos.*', 'tipoequipamentos.descricaotipoequip',…
laravelasked 7 years, 9 months ago Marcos Birro 353 -
1
votes0
answers40
viewsDoubt application Laravel
I am developing an application with Laravel in a Hostgator hosting, but the access path of the entry page (the index) is as follows: http://www.meusite.com/projeto1/public/ How do I get the site…
-
1
votes0
answers47
viewsError giving Migrate command for postgres
Good afternoon, my friends. I am unable to perform the migrate command in the Windows to the postgres. I changed the settings, enabled the driver, but nothing works. Any idea? database.php:…
-
1
votes1
answer104
viewsHow to use decrement in Laravel 5.2 using data from an array?
I’m using the Larable a few months ago and I came across the following problem of controlling stock after purchase automatically. The logic of my system is this:: After purchasing a product in my…
laravelasked 7 years, 9 months ago jardel frank 25 -
1
votes0
answers305
viewsSearch larger field in a table with Eloquent
I’m using Laravel for an API In my comic book I have a table called tbmanifestacao and in this table I have a column called nrmanifestacao I would like in my controller return the biggest…
-
1
votes1
answer265
viewsDisplay options with multiple select and mark the options chosen in Laravel
I have a Collection in the variable $paymentMethods with forms of payment: And I have another Collection in the $timelines variable that has a Many to Many relationship with payment methods. I need…
-
1
votes2
answers686
viewsHow to count the total of records in a limit and offset query?
In a query with paginate I would use the total() in view to return the total of records. Using the limit and offset cannot do this, there is some alternative that does not involve making a new query…
laravelasked 6 years, 10 months ago Diego Vieira 1,807 -
1
votes1
answer50
viewsIoc Laravel Conflict 5.3
I have the following codes: Chat Staff Service namespace Chat\Api\V1\Services\Chat; class ChatStaffService extends Service { private $chatService; public function __construct(ChatService…
-
1
votes1
answer86
viewsCheckbox value is null, Column 'situation' cannot be null
I have a field $table->enum('situacao', ['ativo', 'exonerado']);. I created a checkbox to register, but it returns the following error: 1048 Column 'situation' cannot be null. How can I solve?…
laravel laravel-5 laravel-eloquent laravel-5.3 laravel-bladeasked 6 years, 10 months ago Jonathan Silva Gomes 21 -
1
votes0
answers33
viewsFill base view data only once
I have a view base that has a several dropdowns which depend on database values, calling it "base.blade.php". I also have several other views that extend from this base, for example:…
-
1
votes1
answer41
viewsDoubt with sql on Laravel?
Today I have a query that is returning me duplicate data, I made the change of sql more needed to change it. As I can leave in the same structure of select(DB::raw? The current code looks like this:…
-
1
votes1
answer166
viewsPass Mysql query to Eloquent Laravel
I have a query that when passing to eloquent returns me syntax error. SELECT order_id FROM timelines WHERE order_id NOT IN (SELECT order_id FROM timelines WHERE supplier_approved_id) AND supplier_id…
-
1
votes1
answer873
viewsEloquent: relationships between blog tables
Someone would have a practical example of using relationships in Eloquent as follows: I have a blog with several categories, in these categories I will have several Posts, as I do to display a…
-
1
votes3
answers6930
viewsAsset Help (Laravel Blade)
all right? I’m working on a project with the Laravel framework. In my project I can call a js file, but it doesn’t work. <script src="{{asset('js/formCurriculo.js')}}" type="text/javascript"…
-
1
votes1
answer767
viewsMulti-Insert with Laravel 5.3 dynamic form
I am trying to do a multiple Insert with Laravel 5.3 in a table as follows: Form {!! Form::open(['route' => 'demanda.store', 'class' => 'form']) !!} <div class="form-group form-inline">…
laravel laravel-5 laravel-eloquent laravel-5.3asked 7 years, 9 months ago José Cicero Rocha Cavalcante 11 -
1
votes0
answers130
viewsMigration with custom fields in Laravel
Accustomed to the existing Migration facilities in Asp.net MVC, I have the following question: Is there a way to create Fields in my Model and when running Migration the framework automatically…
-
1
votes2
answers3113
viewsHow to check if the entity already exists in the bank
I am currently working with models, Migrations, Seeds and fakers (Factory) for database testing. So far I’m ordering to insert 1 admin, whose code I present: DB::table('users')->insert([…
-
1
votes0
answers143
viewsLaravel - Error "Tokenmismatchexception" - Form?
Why Laravel keeps giving error after form Ubmit, even inserting in form. {!! csrf_field() !!} Even so this giving the erro === TokenMismatchException Localhost - xamp - W 7 32 bts - PHP 7.2.0 in…
-
1
votes2
answers1298
viewsWhich tool to use for sending SMS in Arabic
Good staff I have a PHP application and I need to send an SMS to some clients but I don’t know how to implement this function , how can I do?
-
1
votes1
answer1213
viewsPassword registration with Hash in Laravel bank
Look guys I’m not able to register the password with the hash in the bank, I can register all data but the password is not encrypted public function CadastroSalvar (Request $request) {…
-
1
votes1
answer128
viewsLaravel 5.2 -> 5.6
I’m taking a course in php/laravel , the teacher uses version 5.2 of the Standard and I would like to use version 5.6 , in case the directories are different, in 5.2 has the folder layouts and in…
-
1
votes1
answer418
viewsLaravel Blade prints unknown values
I use Laravel 5.3. I have a variable that returns this value in a var_dump(): array(3) { [1]=> string(5) "10:00" [2]=> string(5) "10:20" [3]=> string(5) "11:40" } But if I give:…