Questions tagged [laravel-5.6]

Laravel 5.6 is a previous version of the open-source PHP web framework created by Taylor Otwell. It was released on February 7, 2018. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.6. Use the Laravel tag for general Laravel related questions.

Laravel 5.6 is a previous version of Laravel 5. It was released on February 7, 2018.

What is new:

  • Logging Improvements
  • Single Server Task Scheduling
  • Dynamic Rate Limiting
  • Broadcast Channel Classes
  • Model Serialization Improvements
  • Argon2 Password Hashing
  • Collision (Pretty CLI Output)
  • Bootstrap 4

Resources:

1859 questions
6
votes
3 answers

Laravel session timeout, extra logout code

Bottom line: How to logout the user on session time out? Detailed Question: I have a Laravel 5.6.* application and the project demands the user to logout whenever the user is idle. I have tried the solutions that are given here, but none of them…
Saiyan Prince
  • 3,930
  • 4
  • 28
  • 71
6
votes
9 answers

laravel api not showing message from request validation

im having problems with error handler in my backend laravel api, don't show error message from validation. routes/api 'api', ], function ($router) { Route::post('access/sign-up',…
Agustin
  • 215
  • 1
  • 2
  • 14
6
votes
2 answers

Argument 1 passed to App\Http\Controllers\Auth\LoginController::attemptLogin() must be an instance of App\Http\Controllers\Auth\Request

I am adding 1 attribute for authentication, but it doesn't work. i'm not change anything except adding this 2 method in my LoginController protected function credentials(Request $request) { return $request->only($this->username(),…
6
votes
3 answers

Laravel 5.6 Bring site up without commands

I have a Laravel 5.6 website where I want this functionality to be enabled for a non-technical admin, so that he can bring the website down or up at any point of time. I have successfully down the website by using Route::get('shut/down',…
chaitanya swami
  • 420
  • 2
  • 12
6
votes
4 answers

Mock file in Storage to download in Laravel

Is there a way to mock a file using Laravels Storage::fake() method? I have used https://laravel.com/docs/5.7/mocking#storage-fake as a base for my tests, which works fine for uploads. But my download tests are ugly as I have to run my upload route…
Sheph
  • 625
  • 1
  • 6
  • 19
6
votes
2 answers

Uploaded Laravel project on 000WebHost that's not working

I recently uploaded my laravel blog project on 000WebHost, after that I redirected to URL http://laravelcreativeblog.000webhostapp.com/, but I saw this error Whoops, looks like something went wrong., this error is displayed two times one after the…
Usman Developer
  • 568
  • 8
  • 26
6
votes
4 answers

Why use dependency injection for Request object vs request() helper in Laravel?

Is there any benefit to injecting the Request object into your controller method like this: use Request; class WidgetController { public function create(Request $request) { $name = $request->input('name'); } } Versus eliminating the use…
wheelmaker
  • 2,975
  • 2
  • 21
  • 32
6
votes
4 answers

Redirect with compact value in laravel

Route : Route::get('merchantTrans/{id}','MerchantController@merchant'); Merchant Controller : public function merchant($id){ $merchant = Merchant::whereId($id)->get(); return redirect('Merchant view')->with(compact('merchant')); } View…
Samuel Henry
  • 153
  • 1
  • 3
  • 10
6
votes
2 answers

Laravel observer not attaching on pivot table

I have a Category Model which has a parent relation to itself: public function parent() { return $this->belongsTo('App\Models\Category', 'parent_id', 'id'); } and a ManyToMany relation to FieldCategory public function fieldcategories() { …
violator667
  • 469
  • 4
  • 19
6
votes
4 answers

Laravel Eloquent: Detect is empty or count

The main question is how to detect an eloquent collection result is empty or not, what laravel suggest to recognize this? I have two different questions about this, maybe they are related to each other or not, The first: How can i get the result of…
Hamed Yarandi
  • 1,085
  • 1
  • 12
  • 21
6
votes
4 answers

Get onlyTrashed() does not exist in query builder

I am trying to get trashed rows from table messages: public function trash() { return $this->onlyTrashed() ->where('user_id', '=', $this->_u) ->orWhere('receiver', '=', $this->_u) ->orderBy('deleted_at',…
user8517929
6
votes
2 answers

Trying to create custom log channel Laravel 5.6

Inside config/logging.php: 'channels' => [ 'stack' => [ 'driver' => 'stack', 'channels' => ['single', 'mongo'], ], 'mongo' => [ 'driver' => 'monolog', 'handler' =>…
Tarasovych
  • 2,228
  • 3
  • 19
  • 51
6
votes
2 answers

Vuejs Axios data not showing

The problem of not showing information is delayed in fetching , i need any help for this problem.

@{{message}}

Nawfal Kh
  • 63
  • 1
  • 5
6
votes
2 answers

Log Javascript console output in Laravel Dusk

I am using Laravel 5.6 and Laravel Dusk 3.0.9. Dusk is pretty handy, but when a test fails on a page where there is some Javascript functionality it can be pretty hard to work out what went wrong. Dusk generates a screenshot, which helps, but what…
Don't Panic
  • 13,965
  • 5
  • 32
  • 51
6
votes
3 answers

Laravel 5.6 env('APP_BASE_URL') returns null

In staging and production environment, when I try to get my custom defined variable from .env file, it returns null. I have tried creating new Key for APP and cleared all sort of caches, but result is same. APP_NAME="App -…
danyal14
  • 367
  • 1
  • 4
  • 18