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
0
votes
1 answer

Laravel relationship not working but foreign key has a value

I have a user model, in the model I have an integer field called role_id. if I echo out that value {{ $user->role_id }} I get a number back, I also have a relationship setup on the user model to the role model, but if I try and do {{…
Neo
  • 2,305
  • 4
  • 36
  • 70
0
votes
1 answer

How can I install laravel on ubuntu 18.04

I am trying to install laravel 5.6 via composer on ubuntu 18.04 but i have this error: Any help ?
0
votes
1 answer

hasOne relation on same model not working in laravel 5.6

I want to store a model id in same table with different column rel_id having a relation with the id column, but the relation hasOne not working, showing this error: Cannot redeclare App\Models\Employee:supervisor() class Employee extends Model { …
user8144524
0
votes
2 answers

Blade view show relationship data

I have a Client model, the client belongs to many client addresses. on the controller the show method passes in the Client but if I try and access the addresses method it throws the below error. Invalid argument supplied for foreach() (View:…
Neo
  • 2,305
  • 4
  • 36
  • 70
0
votes
2 answers

General error 1215: cannot add foreign key constraint

I'm getting the following error: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table subtags add constraint subtags_tag_id_foreign foreign key (tag_id) references id (tags) on delete cascade) After looking at…
Jjampong
  • 584
  • 1
  • 4
  • 19
0
votes
2 answers

Laravel destroy function always delete the record with lowest id

im new to laravel. So im trying to delete a record from database from my index page. But it only delete the record with the lowest primary key value, my id field. Here's my controller code for destroy function: public function destroy(Province…
m5kev4n
  • 541
  • 1
  • 8
  • 20
0
votes
3 answers

Change default login/register url in Laravel 5.6

I'm working with Laravel 5.6 and the out-of-the-box Login/register methods are just what I need. I managed to remove the annoying "/public" bit on the URL by renaming server.php on the root of the "myapp" folder to index.php and then copying the…
Meloku
  • 45
  • 1
  • 2
  • 9
0
votes
0 answers

Policy in Laravel 5.6

I'm trying to have access level control through policy in my Laravel 5.6 application. I have a Subscriber model and a Company model, Subscribers are only given access to Company by there office locations according to states/region, i.e. a subscriber…
Nitish Kumar
  • 6,054
  • 21
  • 82
  • 148
0
votes
1 answer

How to create facade for singleton in Laravel?

I want to create a facade for a singleton that I'v defined in ServiceProvider: $this->app->singleton('\ActivityLogger\ActivityLoggerInterface', '\ActivityLogger\ActivityLogger'); How can I have something like this in my…
user9640382
0
votes
1 answer

Cannot prevent Laravel from throttling feature tests on circleci

Using Laravel 5.6 I don't want to use withoutMiddleware - I am trying instead to override the default throttle settings, but nothing seems to work. 'api' => [ 'throttle:60,1', 'auth:api', ], Changing the throttle number seems to do…
Tim Ogilvy
  • 1,923
  • 1
  • 24
  • 36
0
votes
1 answer

Laravel looking for the wrong table

I have specified the table name in the model class. Laravel 5.6, PHP 7 namespace App; use Illuminate\Database\Eloquent\Model; class SizeProduct extends Model { protected $table = 'size_product'; protected $fillable = ['product_id',…
wanjydan
  • 129
  • 1
  • 2
  • 12
0
votes
1 answer

How to increment a column values by 1 while creating factory in laravel 5.6?

I want to generate 1000 users and then generate another 1000 record for the NewUser table which is working properly but the registration_no field is breaking the unique key constraint. So i guess its always storing value 1 in registration field. …
Raj
  • 1,928
  • 3
  • 29
  • 53
0
votes
1 answer

How to use Laravel Collection groupBy along with Query Pagination?

I love using Laravel's groupBy function https://laravel.com/docs/5.6/collections#method-groupby However, I cannot use it with paginate(x) function since it return a limited number of results. Groupby of SQL Query and Laravel Collections's GroupBy is…
SNaRe
  • 1,997
  • 6
  • 32
  • 68
0
votes
3 answers

Laravel 5.6 Return wrong ID in foorloop

In the loop below i am getting the packages and returning their data in a card normally. everything works but if i want to delete a specific package by their id. For example when i want to delete package with ID of 1 it rather deletes package ID of…
Roho
  • 23
  • 1
  • 6
0
votes
1 answer

Laravel Query Builder Issue

I'm trying to make it so that the items pulled from the database are only from the current month, however when I do this using various methods it throws an error (which I can't debug due to a the issue mentioned here). In the code below if I just…
Kankuro
  • 305
  • 3
  • 10
1 2 3
99
100