I have this Contractor Model And ContractorDetails Model I can retrieve all columns under the Contractors Model, but whenever I do this $contractors->ContractorDetails->id, it will show this error “Trying to get property ‘id’ of non-object” . however when I just use this $contractors->ContractorDetails, it is able to show this collection {“id”:6,”contractors_id”:24} My controller looks like this My blade file Any
Tag: laravel-blade
Laravel pass collection to view
I’m trying to pass a collection to the view but I’m not getting anything. The page renders blank In the blade I have The result is Error: Trying to get property ‘anything’ of non-object From what I found this should work, please let me know what I`m doing wrong Thanks for your help Answer You forgot to add the ->get()
Blade Recursive, increase the depth for padding
I want to increase the depth int each time children are in a item so I can pad out the a tag. Below is my code and I assumed this would work, however the number stays at 1 even though I have got children within my one of the items within $items. sidebar.blade.php sidebar.items.blade.php SidebarItems.php Data: Result: Answer If I
Laravel relative paths not working as expected on localhost
I’m just using Mac OS’s native apache2 server for my localhost. In my httpd.conf file, I set DocumentRoot “/Users/user_name/Local Sites/” …that directory houses all my sites I work on locally: So, for my particular Laravel project for site_1, I set the following in .env: APP_URL=http://localhost/site_1 …and again in config/app.php: ‘url’ => env(‘APP_URL’, ‘http://localhost/site_1’), However, when I try to use one
Laravel only one friend_id per user
I’m only starting with laravel and was wondering if anyone could help, I’ve created a friend_id and user_id from the database and have made a form in the view that adds the user_id to the friend_id (not sure what the terminology is for anything yet XD) everything working fine but each time I press the add friend button the friend
Why Laravel 7 Generates Views in /storage/framework/views/, and how to stop creating them?
Laravel keeps generating views simultaneously with the views I am editing. Answer You can do that but for that you have to edit Laravel’s core files, it is not advisable. You can delete the views generated in storage folder by using following artisan command.
Error:The POST method is not supported for this route. Supported methods: GET, HEAD
i am trying to make working a simple example a form request but I am stuck below is my simple code Here is the register.blade.php file: here is the controller: here is the route files the error that i code is this what i miss?? i think the problem its too simple but i cant find it maybe the problem
Laravel: Joining tables in Laravel and loop on the other tables
I am joining 3 tables, property, facilities, and images. A property has many facilities and has many images. On my query its looping the same property how many times it has facilities and images and …
Laravel 8.15.0/Jetstream – How to register new blades x-jet-newblade?
I am just doing my very first steps with Laravel 8 and found a problem that I can not solve. /var/www/html/laravel/resources/views/dashboard.blade.php: If i create a new blade in the same directory (f.e. the form.blade.php) with the same code as above but with <x-jet-subform/> instead of <x-jet-welcome> it should normally redirect to the subform.blade.php which is located under var/www/html/laravel/resources/views/vendor/jetstream/components/subform.blade.php But if
Laravel object value with Blade statement does not work if model has accessor
i have an Laravel object model with accessor: and i want to print the nomeAlimento value in a Blade page with Blade statement, for example: but the value inside the table cell is not printed, as if $planRow->foodName is null. In reality it is not empty, in fact if I print {{$planRow}} the structure of the object is complete, and