Return to homepage
03/44. Introducing nested sets
This episode is for premium members only.

Take your skills to the next level with a premium membership.

Join now

Already a member? Sign in and enjoy.



hi i copied and pasted the seeder and it says to do in the populating areas section of this course. for some reason the elouquent event listener that we made in the appserviceprovider.php is not be recognized. it says Class 'App\Area' not found and wont let me seed or do anything in my cmd. I then declared app area at the top of page using this code.

use App\Area; use App\Category;

Somone help please !

  • 0

Having issues on episode #29. When I do a dummy listing and try to click on it to test it, I get this error:

Trying to get property 'created_at' of non-object (View: /var/www/html/sell/resources/views/listings/partials/_listing_favourite.blade.php) (View: /var/www/html/sell/resources/views/listings/partials/_listing_favourite.blade.php)

Here is my code for the _listing_favorite.blade.php

@component ('listings.partials._base_listing', compact('listing'))


1<li> Added {{ $listing->pivot->created_at->diffForHumans() }} </li>
3<li> <a href="#" onlick="event.preventDefault(); document.getElementById('listings-favourites-destroy').submit();">Delete</a> </li>
1{{ csrf_field() }}
2{{ method_field('DELETE') }}



  • 0

On the indexing listings video I am getting the following error when i try to import my listings: Algolia\AlgoliaSearch\Exceptions\UnreachableException : Impossible to connect, please check your Algolia Application Id. I am runing the the laravel application on localhost via ampps which i think me have something to do with it. Can anyone help?

  • 0

It's possible to add pictures for the products and also use the carrousel of javascript so the keep going one by one in the page? I mean like this: I need something like this for my college project, Thanks

  • 0

England is my city!

  • 4

Hie guys! my full search is not working , its just not responding,,,,,,is there a problem with autocomplete or drop down??

  • 0

FatalThrowableError Class 'App\Http\Controllers\Listing\Listingsub' not found

I have been trying to extend the classified tutorial. Adding the pictures for listing.

In listing model, I defined relationship as,

1public function listingPictures()
2 {
3 return $this->hasMany(Listingsub::class, 'listing_ pictures');
4 }

In ListingPicturesControllers

1public function store(StoreListingPictureFormRequest $request, Area $area, Listing $listing)
2 {
3 $ picture = new Listingsub;
4 $ picture ->name = $request-> picture _name;
5$ picture ->direction = $request-> picture _direction;
7 $picture->save();
9 return back()->withSuccess(‘Picture added successfully');
10 }

Here is the model

1 <?php
2namespace App;
3use Illuminate\Database\Eloquent\Model;
4class Listingsub extends Model
6 public function pictures()
7 {
8 return $this->belongsTo(Listing::class, 'listing_pictures');
9 }

I cant be able to store the data in the database. Please help how to save the data in listing_ pictures table?

  • 0

Migration gives me foolwing error

Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = classified and table_name = migrations)

at /Applications/MAMP/htdocs/laravel/classified/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) {

664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668|

Exception trace:

1 PDOException::("SQLSTATE[HY000] [2002] Connection refused") /Applications/MAMP/htdocs/laravel/classified/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

2 PDO::__construct("mysql:host=;port=3306;dbname=classified", "code", "Neder2land", []) /Applications/MAMP/htdocs/laravel/classified/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68

Please use the argument -v to see more details.

Have no clue what this is Can somenbody help me out here Please

  • 0

Have you tried this solution?

  • 0

First off all thx Vasile that you have replied to my question, considering the your answer yes I did't that way you pointed to and it still the same

  • 0

Sorry I could not help! I use Homestead personally and never encountered this issue.

  • 0

CategoryController.php is giving following error.

syntax error, unexpected '{', expecting identifier (T_STRING) in CategoryController.php line 5

and the code for CategoryController.php is,

3namespace App\Http\Controllers\Category;
5use App\{Area, Category};
6use Illuminate\Http\Request;
7use App\Http\Controllers\Controller;

please help me to solve this error, thank you..

  • 0

If you use php version under 7.1, you can't use this format:

use App{Area, Category};

You have to use like this:

use App\Area; use App\Category;

  • 0

I assume you've already fixed the problem, but I guess this may be related with the way you're trying to import App\Area and App\Category classes. This syntax: use App\{Area, Category};
is a PHP 7+ syntax, so if you're using an older PHP version, then try to import those classes like this:

1use App\Area;
2use App\Category;

Hope that helps!

Edit: Oops, did not realize this was already answered 🤓

  • 0

Alex, now site looks very nice and more organized!

  • 0