Skip to content
Advertisement

Tag: laravel-blade

Error in showing laravel data to blade using eloquent

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

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

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

Advertisement