I am using Laravel Passport to secure my REST API. Currently I create Personal Access Tokens using $user->createToken(‘APP_NAME’)->accessToken, but these have no expiration date. So I wanted to create a Password Access Token. I noticed, that these are generated by the AccessTokenController.i…
Tag: laravel
Laravel 5.6 – User not getting authenticated
I have looked for days, but my user never gets authenticated when using the auth middleware. We don’t use the standard laravel way, but using the standard auth middleware to block access to a route group. (in this example the dashboards) The data is correct as it doesnt give any error message, but the u…
Laravel multi result set query builder
I have a MSSQL stored procedure : And i am executing this with my laravel app : It just returns me the first SELECT query result. How can i get both result sets? Answer Solved by writing bellow function :
Difficulty setting Virtual Host on Port 8080
I am using XAMPP and running PORT:8080. I am trying to set up a virtual host and have tried every thing on the internet to set it up but still finding it difficult. It shows this ERROR on chrome …
How to execute a raw sql query with multiple statement with laravel
Is there anyway I can execute a query with multiple statement like the one below, using laravel framework. I have tried using DB::statement but returned a sql syntax error, but when I execute the same query on phpmyadmin I works, its so frustrating. Please help me. EG Answer DB::unprepared() should do the tri…
Laravel unique validation on multiple columns
I have 2 columns in table servers. I have columns ip and hostname. I have validation: This working only for column ip. But how to do that it would work and for column hostname? I want validate data.ip with columns ip and hostname. Because can be duplicates in columns ip and hostname, when user write ip. Answe…
How to set the username and password for the admin using database table?
I have created a website with login form for the administrator. I have the admin table in my database. I added the values in the table but when I try to login, the password is not being accepted. My table is as below How can I set username and password for admins using database table? Answer You should create…
Save all record records using request->all in Laravel
Laravel provides a great help for developers to save all input fields of a form which is one record with one line of code. like if I want to save a form which has multiple input fields and one record to database like: then I can save it with below code and it works great: Now I have a question.
Laravel Multiple Sortby Not Working Properly
i have some issues with laravel sortBy ( laravel 5.4 ) .. based on what i read on many websites, it says that for doing multiple sortBy laravel was by using reverse order.. so i try to do that.. but still not working properly.. So here it is.. I have this collection of object… My Goal is to have this
Make Laravel’s notIn validation rule case insensitive
I am storing an array of strings in my database (db column type is JSON). There is a form that allows users to add a value to this array. I want to make sure there are no duplicates in this array. The notIn validation rule appears be the simplest solution to prevent duplicates but it is case sensitive. So whe…