Questions tagged [laravel-5.5]

Laravel 5.5 is a previous version, but the current LTS version, of the open-source PHP web framework created by Taylor Otwell. It was released on August 30, 2017. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.5. Use the laravel tag for general laravel related questions.

Laravel 5.5 is a previous version, but current LTS version, of Laravel 5. It was released on August 30,2017.

What is new:

  • New Whoops integration
  • Streamlined Request Validation
  • Fresh Migrations
  • Frontend Presets
  • Automatic Package Discovery
  • Silky Smooth Custom Validation Rules
  • Collection Dumping
  • Model Factory Generation
  • Custom Blade "If" Directives
  • Auto-Registering Artisan Commands
  • Higher Order Tap
  • Optional Objects
  • New API Resources

Resources:

2496 questions
118
votes
20 answers

"The page has expired due to inactivity" - Laravel 5.5

My register page is showing the form properly with CsrfToken ({{ csrf_field() }}) present in the form). Form HTML
{{ csrf_field() }} …
Sougata Bose
  • 31,517
  • 8
  • 49
  • 87
84
votes
7 answers

laravel: function in model must return a relationship instance

I try to build a path for a model on laravel I created a function in my model: public function path() { return App\Helper\GeneralController::getURL($this); } with dd(App\Helper\GeneralController::getURL($this)) test I got the right answer.…
Ali
  • 1,127
  • 1
  • 10
  • 23
74
votes
15 answers

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?

When I run composer install on command promp, there exist error like this : Problem 1 - Installation request for laravel/horizon v1.1.0 -> satisfiable by laravel/horizon[v1.1.0]. - laravel/horizon v1.1.0 requires ext-pcntl * -> the…
moses toh
  • 12,344
  • 71
  • 243
  • 443
55
votes
5 answers

laravel APi resource Call to undefined method Illuminate\Database\Query\Builder::mapInto()

i have Post and User model with one to one relation and it works good: //User.php public function post(){ return $this->hasOne(Post::class); } // Post.php public function user() { return $this->belongsTo(User::class); } now i create API…
DaveIt
  • 799
  • 1
  • 8
  • 15
47
votes
15 answers

Node MODULE_NOT_FOUND

I just upgraded to node version 9.0.0 and am now getting this error in the command line when trying to use npm install npm ERR! code MODULE_NOT_FOUND npm ERR! Cannot find module 'internal/util/types' I'm using: OSX 10.10.5 Node version 9.0.0 NPM…
user3325126
  • 1,284
  • 4
  • 15
  • 36
44
votes
3 answers

laravel/framework requires ext-mbstring

I am using Kali linux and I am having difficulty installing the laravel framework. I havelooked up in different links like this one and manyothers but nothing seems to work. For every this I do. It keeps bringing this error laravel/framework v5.5.9…
Pyr James
  • 711
  • 1
  • 6
  • 10
41
votes
7 answers

PHP Parse error: syntax error, unexpected '?' in helpers.php 233

When I create a new Laravel project, the browser displays an error 500. I found this in the log: PHP Parse error: syntax error, unexpected '?' in vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233 the code in 233…
Cui Mingda
  • 803
  • 1
  • 6
  • 15
40
votes
14 answers

Laravel Eloquent $model->save() not saving but no error

When updating my Post model, I run: $post->title = request('title'); $post->body = request('body'); $post->save(); This does not update my post. But it should according to the Laravel docs on updating Eloquent models. Why is my model not being…
Jacob
  • 1,560
  • 4
  • 19
  • 41
34
votes
8 answers

Laravel File Storage delete all files in directory

Is there a way to delete all files in specific directory. I'm trying to clear all my files in my created folder backgrounds in storage\app\backgrounds but in docs seems no method for delete all. Storage::delete('backgrounds\*.jpg');
ßiansor Å. Ålmerol
  • 2,849
  • 3
  • 22
  • 24
31
votes
2 answers

Visual Studio Code can't find files inside vendor folder (Laravel project)

I'm working with Laravel 5.5 and I use Visual Studio Code for code editor. After last update, VS Code freaked out. The main problem is that I can't search files inside vendor folder with ctrl+p. I can search and find any files except inside vendor…
rufatZZ
  • 743
  • 2
  • 11
  • 27
28
votes
3 answers

Laravel How to remove "api" Prefix from subdomain URL

I have created a Laravel application which is both Web application and provides REST APIs to android and iOS platforms. I have two route files one is api.php and other is web.php and routes\api.php routing as follows: routes/api.php …
Lakshmaji
  • 899
  • 2
  • 14
  • 30
28
votes
7 answers

Poor whereHas performance in Laravel

I want to apply a where condition to relation. Here's what I do: Replay::whereHas('players', function ($query) { $query->where('battletag_name', 'test'); })->limit(100); It generates the following query: select * from `replays` where exists ( …
Poma
  • 8,174
  • 18
  • 82
  • 144
27
votes
7 answers

Laravel 5.5 with MySQL 8.0.11: 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'

I've just installed MySQL 8.0.11, transfered my app's database into it and changed the laravel database settings to use the new one. Now everytime I try to login I get the following error: ERROR 1231 (42000): Variable 'sql_mode' can't be set to the…
manifestor
  • 1,352
  • 6
  • 19
  • 34
27
votes
3 answers

How to remove unique constraint from a column using Laravel migrations?

I have to remove a unique constraint from an email column using Laravel migrations. Here is my code: class AlterEmailToUsers extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users',…
aishazafar
  • 1,024
  • 3
  • 15
  • 35
25
votes
6 answers

Invalid datetime format: 1366 Incorrect string value

I'm getting this error: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xBD Inch...' for column 'column-name' at row 1 My database, table, and column have the format utf8mb4_unicode_ci also column-name is type text and…
gvd
  • 1,482
  • 6
  • 32
  • 58
1
2 3
99 100