Questions tagged [laravel-5.8]

Laravel 5.8 is the previous stable version of the open-source PHP web framework created by Taylor Otwell. It was released on February 26, 2019. Use it in addition to the [laravel-5] tag if your question is specific to Laravel 5.8. Use the [laravel] tag for general Laravel related questions.

Laravel 5.8 is the previous stable version of the open-source PHP web framework created by Taylor Otwell. It was released on February 26, 2019.

What is new:

  • Eloquent HasOneThrough Relationship
  • Auto-Discovery Of Model Policies
  • PSR-16 Cache Compliance
  • Multiple Broadcast Authentication Guards
  • Token Guard Token Hashing
  • Improved Email Validation
  • Default Scheduler Timezone
  • Intermediate Table / Pivot Model Events
  • Artisan Call Improvements
  • Mock / Spy Testing Helper Methods
  • Eloquent Resource Key Preservation
  • Higher Order orWhere Eloquent Method
  • Artisan Serve Improvements
  • Blade File Mapping
  • DynamoDB Cache / Session Drivers
  • Carbon 2.0 Support
  • Pheanstalk 4.0 Support

Resources:

1845 questions
9
votes
2 answers

Laravels syncWithoutDetaching and additional data

I have Googled my fingers sore, and I can't see anyone discussing this, but I have a suspicion that Laravels syncWithoutDetaching() method doesn't take any parameters for extra data like save(), sync() and attach() does? Does anybody know this? In…
rebellion
  • 6,628
  • 11
  • 48
  • 79
8
votes
4 answers

Search Data from multiple tables laravel

I am trying to search multiple data from two related tables. To be specific I want to get only "name column" from the users table and the rest of the columns from the posts table. But whenever I tried to search it prints the following error "Trying…
Owdenpk
  • 97
  • 1
  • 1
  • 7
8
votes
7 answers

custom validation message in vee-validate

I am using Laravel - 5.8 with Vue.js. My question is about how to show a custom error message for a rule in the Vee-Validate library. My custom message for the "required" rule is not showing, and instead it reads: "The first_name field is required."…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
8
votes
6 answers

Class 'BeyondCode\DumpServer\DumpServerServiceProvider' not found when I make composer install --optimize-autoloader --no-dev

I'm deploying my Laravel application and want to optimize the autoload, normally I would run the command composer install --optimize-autoloader --no-dev This is an application that runs Laravel 5.8. I am getting the following error: In…
F. Dakia
  • 140
  • 1
  • 1
  • 9
8
votes
3 answers

Custom message on Laravel policy authorization

In my Laravel 5.8 project I am implementing a reputation system similar to Stack Exchange's one: for example, users can reply to a discussion only if they have "Level 3" reputation. I wanted to use Laravel's policies system to build the permissions…
Marco Cazzaro
  • 661
  • 8
  • 13
7
votes
6 answers

SQLSTATE[HY000] [1049] Unknown database 'laravel'

I am getting this error while trying to save an object into DB. SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: insert into cards (card_price, active, updated_at, created_at) values (0, 1, 2019-10-10 15:14:43, 2019-10-10…
FEBzX
  • 367
  • 2
  • 5
  • 15
7
votes
1 answer

User authentication in Laravel from xenforo database with using several tables

I have 2 databases: one from Laravel and other from XenForo 2. On Laravel, registration should not take place, but only on the forum in order to reduce data duplication and eliminate the out of sync if it happens for some reason. There are 2 tables…
Vladimir Gonchar
  • 203
  • 5
  • 16
7
votes
4 answers

laravel authorizeResource always denies access

I have created a resource controller for an API endpoint. I have also created a corresponding policy for the model. If I do a per method authorization check using $this->authorize('delete', $asset); then it works as expected. But if I add the…
JaChNo
  • 1,493
  • 9
  • 28
  • 56
7
votes
1 answer

Laravel 5.8 : How to send email after user click verify link

I implemented auth system by php artisan make:auth and already setup user email verify by MustVerify from laravel feature I want to send another email (Greeting mail) after user click verify link. How can I do that?
Don Noinongyao
  • 175
  • 1
  • 9
6
votes
1 answer

Password confirmation doesnot match?

I am trying to using confirm password validation. I applied correct rules. But when it validates then it give me validation error like below: The password confirmation does not match. Controller public function register(Request $req){ …
Ahsan Asif
  • 123
  • 3
  • 9
6
votes
2 answers

How can I call a function of a helper class in a view - Laravel 5.8?

I have a helper class DateHelper I have one fn in there public static function getAgo($date) { if ($date) { $ts = time() - strtotime(str_replace("-","/",$date)); if($ts>31536000) $val = round($ts/31536000,0).' year'; …
code-8
  • 54,650
  • 106
  • 352
  • 604
6
votes
2 answers

Laravel Validation - Rule to disallow request parameters

In my Laravel 5.8 app I have many API routes which return paginated results. If I make a request to my API appending the following query string I can disable pagination. http://api.test/users/?no_paginate=1 My question is... how can I disable…
itsliamoco
  • 1,028
  • 1
  • 12
  • 28
6
votes
3 answers

How to extend or make custom PasswordBroker sendResetLink() method in Laravel 5.8?

Currently the logic behind Resetting Password is that user must provide valid/registered e-mail to receive password recovery e-mail. In my case I don't want to validate if the e-mail is registered or not due to security concerns and I want to just…
richardev
  • 976
  • 1
  • 10
  • 33
6
votes
2 answers

How to make Policy Auto-Discovery new Laravel feature work with my models in a different folder?

I have just updated my Laravel to 5.8 and can't make my Policies auto-discovery work. I think it's because all my models are in app/Models. The documentation says that I can change the default behavior using this…
Mondini
  • 580
  • 4
  • 16
5
votes
4 answers

Laravel Rate Limiter Limits Access Wrongly After Only One Attempt

I'm working with Laravel 5.8 and I wanted to set up a Rate Limiter that limits accessing to route by per minute and also IP address. So I added this to RouteServiceProvider.php: protected function configureRateLimiting() { …
Pouya
  • 114
  • 1
  • 8
  • 36