Build a classified ads site / Introduction and demo

0 complete
44 parts
Next →

1. Introduction and demo

09:34

2. Installing Laravel and setting up

03:14

3. Introducing nested sets

03:06

4. Fake email

01:53

5. Laravel DebugBar

02:18

6. Breaking up the default template

02:31

7. Populating areas

12:41

8. Area selection

08:11

9. Choosing and persisting an area

15:18

10. Populating categories

05:44

11. Listing categories

08:54

12. Setting up listings

15:15

13. Showing listings in categories

19:03

14. Listing count for categories

06:07

15. Showing a listing

13:37

16. Setting up favourites

07:46

17. Adding a favourite listing

11:50

18. Showing favourites

11:28

19. Deleting favourites

04:46

20. Ordering and eager loading improvements

06:40

21. Quick flash messages

04:44

22. Setting up listing views

05:21

23. Logging views

08:48

24. Recently viewed listings

08:25

25. Showing the listing view count

06:17

26. Contact form and validation

07:05

27. Sending the email

11:30

28. Usable areas and categories

04:07

29. Listing form and storing

21:47

30. Handling validation

14:34

31. Editing a listing

12:22

32. Editing live listings improvements

02:08

33. Starting the payment journey

11:25

34. Braintree integration

20:12

35. Processing the payment

06:39

36. Handling free listings

03:23

37. Unpublished listings

19:00

38. Published listings

02:38

39. Deleting a listing

05:33

40. Indexing listings

15:09

41. Basic listing search

14:22

42. The full search experience

24:38

43. Form and validation

18:53

44. Sending emails

09:28

Build a classified ads site

  • 7 hours 8 mins
  • Released 1 year ago

A site that allows users to browse, create and pay for advertisements. Think Craigslist. We'll cover Eloquent techniques, nested sets for flexibility, payment processing and more.

Discussions (10)

paul
1 month ago

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

rocky5469
2 months ago

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,

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

In ListingPicturesControllers

public function store(StoreListingPictureFormRequest $request, Area $area, Listing $listing)
    {
	    $ picture = new Listingsub;
        $ picture ->name = $request-> picture _name;
$ picture ->direction = $request-> picture _direction;        

        $picture->save();

        return back()->withSuccess(‘Picture added successfully');
    }

Here is the model

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

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

Jurgen
3 months ago

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=127.0.0.1;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

Vasile
3 months ago

Have you tried this solution?

Jurgen
3 months ago

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

Vasile
3 months ago

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

rocky5469
4 months ago

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,

<?php

namespace App\Http\Controllers\Category;

use App\{Area, Category};
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

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

Zsolt
4 months ago

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;

Vasile
4 months ago

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:

use App\Area;
use App\Category;

Hope that helps!


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

Mario
6 months ago

Alex, now site looks very nice and more organized!