Questions tagged [laravel-5]

Laravel, introduced during the period between 2015 and 2020, showcases Laravel 5. This particular version of Laravel, an open-source PHP web development MVC framework, was meticulously crafted by Taylor Otwell. It revolutionizes application creation through its straightforward and expressive syntax. For any queries pertaining to Laravel in general, make sure to utilize the efficient laravel tag.

Obtaining unique attributes from Laravel's many-to-many relationships

Currently, I am in the process of developing a module for my laravel web application that allows users to create multiple projects. These projects can have multiple contributors who need to be approved by the owners. The functionality for owner users has b ...

In Laravel 5, the firstOrCreate method ensures that a new record is created if one doesn't already

Displayed below is the code snippet from my app's Cart.php use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Cart extends Model { use SoftDeletes; protected $table = &apo ...

Handling Multiple Email Address Validation in Laravel 5

In Laravel, it is possible to establish validation rules for input fields like the following: $return = [ 'first_name' => 'required|max:300|min:3', 'last_name' => 'required|max:300|min:3', 'email' => 'required|email, ...

The search function in a Laravel controller is not functioning as expected

Here is the controller code snippet I'm using: $test= test::find($id); return $test; Initially, it was returning null. However, when I modified it to: $test= test::where('id',$id)->get(); return $test; it started returning all v ...

Encountered an issue in Laravel 5.7 JSONResource toArray method: Declaration must be compatible

I'm encountering an issue while trying to use the JSON Resource to Array converter in Laravel. Here is a snippet of my code: DataResource.php <?php namespace AppHttpResources; use IlluminateHttpRequest; use IlluminateHttpResourcesJsonJsonReso ...

Best practices for passing multiple values with keys in vue.js when constructing URLs

I am working with this data containing various attributes: for(var k = 0;k<this.form.fields.length;k++) { this.dynamic_fields.push({attribute_id:attributes[k].id,value: attributes[k].value}) ...

Is proc_open() and passthru() required for Laravel to function properly?

Having issues installing laravel on a shared hosting at KVC webhost. Getting a blank page. Checked the log and it seems like proc_open() and passthru() aren't enabled on my server, which is causing errors. Reached out to my webhosting for help but they c ...

Retrieve parent data from a database table and calculate the number of children associated with them in a

How can I retrieve all parents from a table and calculate the number of children they have? Check out my code: DB::table('wiki_page') ->where('wiki_page.parent_id', '=', null) ->get(); Table Structure id | name | parent_id -------- ...