Questions tagged [laravel-6]

Laravel 6.0 is a past main version of the open-source PHP web framework created by Taylor Otwell. It was released on September 3, 2019. Use the [laravel] tag for general Laravel related questions.

Laravel 6.0 (LTS) continues the improvements made in Laravel 5.8 by introducing semantic versioning, compatibility with Laravel Vapor, improved authorization responses, job middleware, lazy collections, sub-query improvements, the extraction of frontend scaffolding to the laravel/ui Composer package, and a variety of other bug fixes and usability improvements.

What is new:

  • Semantic Versioning
  • Laravel Vapor Compatibility
  • Improved Exceptions Via Ignition
  • Improved Authorization Responses
  • Job Middleware
  • Lazy Collections
  • Eloquent Subquery Enhancements
  • Laravel UI

Resources:

1918 questions
0
votes
1 answer

How can I perform database operations on the server. - with Laravel 6.0?

Normally everything works fine on localhost. When I throw the project to the server, only the homepage works. When I add manually to this section from the database, I can pull the data. Web site here: http://elsetea.com/public (running) but when I…
ufuk
  • 367
  • 3
  • 16
0
votes
1 answer

Columns are not saved in DB, Laravel

I try to add value in DB, and after that to get the ID, and to use in another table ,for a column, but it's always null, and I am not sure why. $lkp_location = new LkpLocation(); if (is_numeric($request->lkp_location_text)) { // If I get…
Beusebiu
  • 1,433
  • 4
  • 23
  • 68
0
votes
2 answers

React Native fetch getting an Empty array when making POST request to Laravel Api

I am working on a project for my self learning that has laravel in the backend and running react native in the front end. I have implemented the login and register screen for my apps. Now I am trying to connect it to my laravel server through its…
Furrukh Jamal
  • 142
  • 3
  • 14
0
votes
1 answer

Store Post along with user id, referenced to User table in Laravel 6

I have Post and User Model with relationship as follows: user_id is the foreign key in posts table referenced to the id of the users table Post Model public function user () { return $this->belongsTo(User::class,'user_id','id'); } User Model…
Sami Khan
  • 31
  • 1
  • 8
0
votes
2 answers

What is the correct way to perform a formula in Laravel 6 without repeating the formula each time?

In the database I have a salary for each of my staff. I need to work out how much tax to deduct from the salary, but I don't think I would be correct to hardcode this into each view, something like... {{($bob->salary - 12,000) * 0.2}} It's…
0
votes
0 answers

Laravel 6 - Accessor appends not called in relationships

I use Laravel 6 and I want access to avatar attribute from user when I use posts() relation. User model: /** * @var array */ protected $appends = [ 'avatar', ]; /** * @return HasMany */ public function posts(): HasMany { return…
pirmax
  • 2,054
  • 8
  • 36
  • 69
0
votes
1 answer

Insert value in table relationship Laravel

I want to insert some value in db, but I get an error, and I am not sure why. Trying to get property 'lkp_relationship_correlation' of non-object** $person = new Person(); foreach ($request->relationship_values as $item) { …
Beusebiu
  • 1,433
  • 4
  • 23
  • 68
0
votes
1 answer

Laravel Create Model for a pivot table

I have a MenuItem model which uses menu_items table with the following fields: $table->bigIncrements('id'); $table->string('name')->nullable(false); $table->unsignedBigInteger( 'category_id')->nullable(false); …
MrCujo
  • 1,218
  • 3
  • 31
  • 56
0
votes
1 answer

Laravel - Passing array to @can Blade template

I registered a Gate that should accept an array of integers. Its function is to return true if the user's role id is in that passed array. The code looks like this: Gate::define('access', function ($user, $access_type) { …
Lou
  • 83
  • 1
  • 7
0
votes
1 answer

How to pass the custom variables from ResetPasswordController to reset blade

How to pass the custom variables from ResetPasswordController to reset blade template. ResetPasswordController.php public function showResetForm(Request $request, $token = null) { $data = array( 'title'=>'Reset password', …
Upasana Chauhan
  • 948
  • 1
  • 11
  • 32
0
votes
2 answers

Get unique value from table Laravel

I want to get all rows that have one unique column. The problem with my code is that it works only when I select just that one column, but in the end I need to have multiple columns. $values=…
Beusebiu
  • 1,433
  • 4
  • 23
  • 68
0
votes
1 answer

Laravel 6 - ErrorException Undefined offset: 1. How to find exact line cause by blade file?

it cause by my blade file ErrorException Undefined offset: 1 in the past, Laravel 5 pointed for me what line cause the error in blade file if some thing wrong. Now my blade file so many variable inside. But in Laravel 6, how i can find what exact…
An Bình
  • 1
  • 1
0
votes
3 answers

Laravel 6 Error: On entering login route app crashes

I'll try to explain my issue as much as possible. I just created a Laravel application. Whenever I'm logged in either as a user or admin (user route is http://localhost/Folder/ and admin route is http://localhost/Folder/admin) and I enter the login…
Murtaza Ahmad
  • 267
  • 1
  • 5
  • 16
0
votes
2 answers

How to send a message with login in Laravel?

I have this function for log but I have an error in the compact public function redirectPath() { if (Auth::user()){ $msg_modal = 1; return '/', compact('msg_modal'); } to run this script which show me a modal…
Oscar
  • 139
  • 1
  • 13
0
votes
1 answer

Problem with edit function using a modal Laravel

I have the next function public function edit($id) { if(request()->ajax()) { $data = Tbl_Perimetro::findOrFail($id); return response()->json(['result' => $data]); } } public function update(Request $request,…
Oscar
  • 139
  • 1
  • 13