Melodia

Melodia

Member Since 1 Year Ago

Cape Town

at Home

Experience Points 13,960
Experience Level 3

1,040 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 97
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

14 Sep
1 day ago

Melodia commented on Building The World

Brilliant!

07 Sep
1 week ago

Melodia started a new conversation My Valet Installation Does Not Pink And Brew Services Don't Run Properly

Am having a hard time to run laravel projects on a mac.

After installing homebrew, I ran the following commands:

brew update

brew install php

When I run brew services list, I see the following:

Name    Status  User   Plist
mariadb stopped
mysql   started sidney /Users/sidney/Library/LaunchAgents/homebrew.mxcl.mysql.plist
php     error   root   /Library/LaunchDaemons/homebrew.mxcl.php.plist

composer global require laravel/valet

valet install

When I try to ping: ping test, it takes a few seconds, and then I see this message:

ping: cannot resolve foobar.test: Unknown host

Troubleshooting further, I ran the following commands and saw the respective results:

Sydney-de-Sousas-Mac:~ sidney$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  mariadb
  mysql
Sydney-de-Sousas-Mac:~ sidney$ brew link mariadb
Linking /usr/local/Cellar/mariadb/10.4.6_1... 197 symlinks created
Sydney-de-Sousas-Mac:~ sidney$ brew services list
Name    Status  User   Plist
mariadb stopped
mysql   started sidney /Users/sidney/Library/LaunchAgents/homebrew.mxcl.mysql.plist
php     error   root   /Library/LaunchDaemons/homebrew.mxcl.php.plist
Sydney-de-Sousas-Mac:~ sidney$

How do I successfully install valet and run laravel projects using it?

My system version is 10.13.6 - High Sierra

26 Aug
2 weeks ago

Melodia started a new conversation How Do I Format Json Data From Api Call?

My snippet looks like this:

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://example.example.co.za/api/consumers/get?id=32223&[email protected]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_POSTFIELDS => "",
    CURLOPT_HTTPHEADER => array(
    "Accept: */*",
    "Authorization: Bearer thetoken",
    "Cache-Control: no-cache",
    "Connection: keep-alive",
    "Content-Type: application/x-www-form-urlencoded",
    "accept-encoding: gzip, deflate",
    "cache-control: no-cache",
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

return $response;

The response shows me an object like this:

{
    success: true,
    count: 1,
    data: [{
       id: 3429217,
       brand_id: 2323,
       first_name: "My name",
    }]
}

First: Instead of return the entire JSON, how can I return only the data inside the data key? Second: What would be the best way to do this API call?

20 Aug
3 weeks ago

Melodia left a reply on I Get An Access Denied When I Try To Access My Database After Installing Valet

Right now, I closed all the terminals and re-opened. If I type "mysql", I managed get into the server, but if I try to create a database then I get access denied.

If I exit and try to enter using mysql -uroot I also get access denied as before

Melodia started a new conversation I Get An Access Denied When I Try To Access My Database After Installing Valet

Am currently migrating to mac OSX and I want to use valet for my laravel sites. So here is where I got stuck:

After installing homebrew, PHP and the rest of the requirements that valet needs, when I got to my terminal, I can't access my database.

At first, I had this:

Sydney-de-Sousas-Mac:~ sidney$ mysql -uroot
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (OS errno 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
Sydney-de-Sousas-Mac:~ sidney$ mysql server start
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (OS errno 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!
Sydney-de-Sousas-Mac:~ sidney$ mysql
mysql: Can't read dir of '/usr/local/etc/my.cnf.d' (OS errno 2 - No such file or directory)
mysql: [ERROR] Fatal error in defaults handling. Program aborted!

Then I created the file it requested:

Sydney-de-Sousas-Mac:~ sidney$ mkdir /usr/local/etc/my.cnf.d

But I get access denied when I try to access my DB

Sydney-de-Sousas-Mac:~ sidney$ mysql -uroot
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Sydney-de-Sousas-Mac:~ sidney$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

I thought that by default the password is an empty string.

How do I access my database?

Melodia started a new conversation How To Fix 302 Too Many Redirects

I have a website with multisite set to true.

I can see all the pages regardless of the language, however, If I am on the dashboard, and hover over my sites, I cant see any of the dashboards of the other languages.

After a few seconds a see an error that says too many redirects.

If I inspect the page and view the network tab, I see a 302 error.

I have this in my configuration:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false); // Set to false if you selected the "Sub-directories" installation.
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/*----------------------------------------------------*/
// Authentication unique keys and salts
/*----------------------------------------------------*/
/*
 * @link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service 
 */
define('AUTH_KEY',         'i7a3cyhnq7r89qtnr87639nf70wq3tyy0w9fny089q3fyw78yn0987fcwy890');
define('SECURE_AUTH_KEY',  'io7scyo7fystyf98st86rcts6er7te67ctsert676erctse7r6ts76etv76tr');
define('LOGGED_IN_KEY',    'ij8sddufs8yf657s4c57sfrt8697rf9fn89jsu094s8uf09488us4f089yu0v');
define('NONCE_KEY',        'sdaf8yv65643v5ft68suvs9cu9p0w349u90-48u489wy98fu984f98euf9889');
define('AUTH_SALT',        '9z08jxe6h789mn8b67c8n7xm893n280n7c4mx9cn749mx89cn78438m02n9c7');
define('SECURE_AUTH_SALT', '21333333333780v465bn87b698n7ewc8n48fu848c4mncf4u84wfcum84f4cw');
define('LOGGED_IN_SALT',   'yr5bt3268mu30mu89248mufxy79ny79x9m89u2mu892dxm8u9d2xmu89dx298');
define('NONCE_SALT',       '4e6r57t8yz9u80t6y79n8b6t7rzmy890nxg8zhm0x79gnhmz280gx7989898y');

/*----------------------------------------------------*/
// Custom settings
/*----------------------------------------------------*/
define('WP_AUTO_UPDATE_CORE', false);
define('DISALLOW_FILE_EDIT', true);
define('WP_DEFAULT_THEME', 'themosis-theme');

Inside the htaccess I have this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) cms/ [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ cms/ [L]
RewriteRule . index.php [L]

Options -Indexes

I noticed that there a several question on the web about the same issue, which didn't resolve my issue, so I thought best to also post what I currently have in my users table:

MariaDB [theme]> select * from wp_options limit 10;
+-----------+--------------------+------------------------------+----------+
| option_id | option_name        | option_value                 | autoload |
+-----------+--------------------+------------------------------+----------+
|         1 | siteurl            | http://localhost/cms         | yes      |
|         2 | home               | http://localhost             | yes      |
|         3 | blogname           | Themename                | yes      |
|         4 | blogdescription    |                              | yes      |
|         5 | users_can_register | 0                            | yes      |
|         6 | admin_email        | [email protected] | yes      |
|         7 | start_of_week      | 1                            | yes      |
|         8 | use_balanceTags    | 0                            | yes      |
|         9 | use_smilies        | 1                            | yes      |
|        10 | require_name_email | 1                            | yes      |
+-----------+--------------------+------------------------------+----------+
10 rows in set (0.00 sec)

NOTE: The site was installed with docker, so the file structure does not look exactly the same like in regular WordPress sites.

From the root directory, my site sits under htdocs/content/themes/themename

To login to the main dashboard, I type: localhost/cms/login

MORE INFO: This is a WordPress site that uses themosis framework, which is based on Laravel, however, during all this time I am spedning to try to fix this, I noticed that this is very likely to do with the htaccess. As a matter of fact, If I inspect my network tab, I see a 302 error that fires of about 8 times.

How can I view the dashboard for the other languages?

03 Aug
1 month ago

Melodia left a reply on How Do I Set An End Point With An Array Of Values

I just updated my question.

Melodia left a reply on How Do I Set An End Point With An Array Of Values

I still get the exact same error and am almost sure that the issue is in the js side when I do this:

let order = this.order.map(x => x.id);

console.log(order);
axios.get('api/list/order/' + order)
.then(res => console.log(res.data))
.catch(err => console.log(err));

it seems like the url is not receiving the order from "let order" as an array.

Melodia started a new conversation How Do I Set An End Point With An Array Of Values

I used localstorage to save the product id of every product that is added to the cart.

Then I have a button called "View Order". When I click on that button, I want to view details of each product that has been added to the cart such as the title, description, image and be able to update the quantity.

The view order button calls a function which looks like the following:

view_order(){
    if (localStorage.getItem('order')) {
        try {
            this.order = JSON.parse(localStorage.getItem('order'));
            this.$store.dispatch('list_orders', this.order.length);
        } catch(e) {
            localStorage.removeItem('order');
        }

    }
    const order = this.order.map(x => x.id); //[array of order ids]

    axios.get('api/list/order/', {
        params: {
            order: order
        }
    })
    .then(res => console.log(res.data))
    .catch(err => console.log(err));

}

In web.php I have this:

Route::get('api/list/order/{order?}', '[email protected]_order');

In the OrderController I have this:

public function list_order($order = null){
    if ($order == null) {
        abort(404, 'No order was passed');
    }

    $order = explode(',', $order);
    
    $orders = DB::table('products')->whereIn('id', $order)->get();

    return $orders;
}

When I click on view order I see the following error in the console:

VM4305:1 GET http://challenge-shopping.local/api/list/order?order[]=3&order[]=2 404 (Not Found)
02 Aug
1 month ago

Melodia started a new conversation How Do I Create A Unique Session For A User That Is Not Logged In

For this task, created an end-point that lists all products using VueX and the template has this:

<div v-for="p in products" class="col col-md-4">
    <div><span class="title">{{ p.title }}</span> | <span class="price">R{{ p.price }}</span> </div>
    <p>{{ p.description | counter }}</p>
    <button @click="order" class="add-cart btn btn-primary">Order Now</button>
</div>

When I click to order, an order method needs to get fired which will add that particular product into the cart.

methods: {
    order(){
        //update cart object
    }
}

However, to proceed to checkout, the user needs to be logged in and am using the laravel auth.

Since the cart details are to be stored in a cart object, the cart details need to be available even after the page refreshes to the login. and I assume I need to have a type of session for as soon as the user enters on the page for the very first time.

How can I achieve this? How can I let the system record the cart details before the user is logged in and remember it even after the page reloads?

Hope the explanation makes sense.

11 Jan
8 months ago

Melodia started a new conversation How To Access Json Data From Database

I entered information into my database like this:

public function addFlight(){
    Flight::create([
        'name' => 'Sidney',
        'address' => [
            'street' => 'Williams road',
            'suburb' => 'Parow'
        ]
    ]);
    return "Saved";
}

So, in my database, address is stored as json and I have this done inside my model:

protected $casts = [
    'address' => 'array'
];

What I want now, is to get the address information everytime I am looping through the flights.At the moment I have this:

public function getFlight(){
    $flights = Flight::all();
    foreach ($flights as $flight) {
        foreach($flight->address as $address){
            echo $address->street;
        }
    }
}

How do I access the address information(street and suburb) ?

At the moment, if I try to access the getFlights method via url, I get the following error:

Trying to get property 'street' of non-object

Hope that someone can help

11 Dec
9 months ago

Melodia left a reply on How Can I Create A Folder For Each Registration On Amazon S3

@MTHOMAS - I see why one of my previous attempts didnt work. I had in a different structure.

Storage::disk('3')->put($file->getClientOriginalName(), fopen($file, 'r+'), 'public/' . $business->id )

Well, I also didnt have the makeDirectory command

Your code works on my storage. Am just going to check now if it also gets added to aws

How would I retrieve the image from a specific folder?

Say, I want to retrive the images from business id number 20

Melodia left a reply on How Can I Create A Folder For Each Registration On Amazon S3

@MTHOMAS - This creates the folder inside my public folder yes, but the files for that particular business are still being added outside that folder.

This is what I have now:

        $directory = 'public/' . $business->id;
        Storage::disk()->makeDirectory($directory);

        foreach($files as $file) {
            if ($file) {
                Storage::disk()->put($file->getClientOriginalName(), fopen($file, 'r+'));                   
            }
        }

Melodia started a new conversation How Can I Create A Folder For Each Registration On Amazon S3

I am using Amazon S3 to add files to it for my business registration system.

Inside the store method I have the following:

$input              = $request->all();

$files              = isset($input['file']) ? $input['file'] : array ();
$business_names     = json_decode($input['business_names'], true);
$business_details   = json_decode($input['business_details']);
$share_amount       = json_decode($input['share_amount'], true);
$entity             = json_decode($input['entity'], true);
$directors          = json_decode($input['directors'], true);
$shareholders       = json_decode($input['shareholders'], true);
$appointments       = json_decode($input['appointments'], true);

$input['user_id'] = Auth::user()->id;

Log::info(Auth::user());
Log::info($request->user());
/* Create Business Record */
$business = new Business;
$business->business_names = json_encode($business_names);
$business->share_amount = $share_amount ?: 0;
$business->entity = $entity ?: '';
$business->business_physical_address = json_encode($business_details->physical_address);
$business->has_business_postal_address = $business_details->has_postal_address;
$business->business_postal_address = json_encode($business_details->postal_address);
$business->user_id = $input['user_id'];
$business->save();

/* Upload Files */
foreach($files as $file) {
    if ($file) {
        Storage::disk()->put($file->getClientOriginalName(), fopen($file, 'r+'), 'public');
        // $file->storeAs('files/' . $business->id, $file->getClientOriginalName());
    }
} 

All works until now...but what I want something more organized, in a sense that, every time I save a new business, a folder is also created with that business id and the images should be added to that particular folder.

I tried this:

 Storage::disk('s3')->put($file->getClientOriginalName(), fopen($file, 'r+'), 'public/' . $business->id);

But I see the following error when I try to save a business:

#0 C:\xampp\htdocs\startingabandbaby\vendor\league\flysystem\src\Adapter\Local.php(356): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined index...', 'C:\xampp\htdocs...', 356, Array)

Any way around that?

05 Dec
9 months ago

Melodia left a reply on Search Query Not Working With Min And Max Values

@d9705996 thinking of your last answer, I decided to alter my price data type to double, seeded some data and it seems like it works properly.

It happened that my price was a string type because I was using comma separation with javascript. Using double does not work.

Perhaps you would have an answer for that. Other than that we consider the question answered.

Melodia left a reply on Search Query Not Working With Min And Max Values

@D9705996 - I am soring price as a string.

Now I search the following:

https://mydomain.com/search?city_suburb=&type=&min_price=&max_price=2000000&bedrooms=&bathrooms=

I am expecting to view all properties which the price does not exceed 2000000...but the result shows me properties that cost 2600000, 20000000 and more.

In a different attempt I tried this:

https://mydomain.com/search?city_suburb=&type=&min_price=450000&max_price=&bedrooms=&bathrooms=

The results page show nothing...but I am expecting to see all properties which the price is equal or greater than 450000

Melodia left a reply on Search Query Not Working With Min And Max Values

@DANHORTON - If I follow your add-on logic, it still doesnt work.

For instance, I checked a property which min price is 1000000

http:/mydomain.com/search?city_suburb=&type=&min_price=1000000&max_price=&bedrooms=&bathrooms=

But the response shows me a properties which the price are even 500000 here is how my currently snippet looks like:

PropertyController.php

public function search_page(PropertyFilters $filters)
{
    $properties =  $this->getProperties($filters);

    return view('pages.search', compact('properties'));

} 

protected function getProperties(PropertyFilters $filters)
{
    $bids = Property::filter($filters);
    
    return $bids->paginate(9);
} 

PropertyFilters.php

protected $filters = ['city_suburb', 'type', 'min_price', 'max_price', 'bathrooms', 'bedrooms'];

public function city_suburb($city){
    if(!$city) {
       return $this->builder;
    } 
    return $this->builder->where('city', $city)->orWhere('suburb', $city);
}

public function type($type){
    if(!$type) {
       return $this->builder;
    } 
    return $this->builder->where('type', $type);
}

public function min_price($price){
    if(!$price) {
       return $this->builder;
    } 
    return $this->builder->where('price', '>=', $price);
}

 public function max_price($price){
    if(!$price) {
       return $this->builder;
    } 
    return $this->builder->where('price', '<=', $price);
}

public function bathrooms($bathrooms){
    if(!$bathrooms) {
       return $this->builder;
    }       
    return $this->builder->where('bathrooms', $bathrooms);
}

public function bedrooms($bedrooms){
    if(!$bedrooms) {
       return $this->builder;
    }       
    return $this->builder->where('bedrooms', $bedrooms);
}

Particularly for this line of code:

protected $filters = ['city_suburb', 'type', 'min_price', 'max_price', 'bathrooms', 'bedrooms'];

Why exactly do I have this array when I dont use the values? Because dont have min_price and max_price in the database.

Just trying to understand.

04 Dec
9 months ago

Melodia left a reply on Search Query Not Working With Min And Max Values

@D9705996 - nothing regarding the price works...whether I filter in isolation or with both min and max price.And note that if I do this:

public function min_price($price){
Log::debug($price);
if(!$price) {
   return $this->builder;
} 
return $this->builder->where('price', '>=', $price);
}

I get the price in my log

Melodia left a reply on Search Query Not Working With Min And Max Values

@DANHORTON - I do not quite follow the answer. what do I do with the protected filters array?

is it possible to have a full snippet based on mine?

Melodia left a reply on Search Query Not Working With Min And Max Values

@D9705996 - https://mydomain.com/search?city_suburb=&type=&min_price=1000000&max_price=&bedrooms=&bathrooms=

https://mydomain.com/search?city_suburb=&type=&min_price=&max_price=2000000&bedrooms=&bathrooms=

Melodia left a reply on How Can I Make A More Refine Search Result

@D9705996 - I was testing the search again and noticed that the min query for some reason does not work. I explain in more details in a new question and really hope you can help:

https://laracasts.com/discuss/channels/laravel/search-query-not-working-with-min-and-max-values

03 Dec
9 months ago

Melodia started a new conversation Search Query Not Working With Min And Max Values

I have form with multiple search input fields, which min and max values are included. When I try to search all properties which min price is 450 000 I see nothing, but in my database I have properties that are 2 000 000. Also on the same note, If put 1 000 000 as max value It shows me properties that are even 2 000 000.

My search function in the controller:

public function search_page(PropertyFilters $filters)
{
   $properties =  Property::filter($filters)->paginate(9);

   return view('pages.search', compact('properties'));
 
}   

PropertyFilters.php:

public function city_suburb($city){
    if(!$city) {
       return $this->builder;
    } 
    return $this->builder->where('city', $city)->orWhere('suburb', $city);
}

public function type($type){
    if(!$type) {
       return $this->builder;
    } 
    return $this->builder->where('type', $type);
}

public function min_price($price){
    if(!$price) {
       return $this->builder;
    } 
    return $this->builder->where('price', '>=', $price);
}

 public function max_price($price){
    if(!$price) {
       return $this->builder;
    } 
    return $this->builder->where('price', '<=', $price);
}

public function bathrooms($bathrooms){
    if(!$bathrooms) {
       return $this->builder;
    }       
    return $this->builder->where('bathrooms', $bathrooms);
}

public function bedrooms($bedrooms){
    if(!$bedrooms) {
       return $this->builder;
    }       
    return $this->builder->where('bedrooms', $bedrooms);
}

QueryFilter.php

abstract class QueryFilter
{
    protected $request;
    protected $builder;

    public function __construct(Request $request){
        $this->request = $request;
    }

    public function apply(Builder $builder){
        $this->builder = $builder;

        foreach($this->filters() as $name => $value){
            if($value && method_exists($this, $name)){
                call_user_func_array([$this, $name], array_filter([$value]));
            }
        }
        return $this->builder;
    }

    public function filters(){
        return $this->request->all();
    }
}

Anything possibly done wrong in the logic?

29 Nov
9 months ago

Melodia left a reply on Package Does Not Show On The Front-end

@LOSTDREAMER_NL - I jusr ran route,config and cache clear commands and everything works. I just found it weird that I had to clear anything since its just a small project and am not caching anything.

Appreciate the support

Melodia left a reply on Package Does Not Show On The Front-end

Route:list does not show anything and when I dd in both files nothing works. I ran composer dump-autoload and still nothing

28 Nov
9 months ago

Melodia left a reply on Package Does Not Show On The Front-end

@LOSTDREAMER_NL - I actually do have that line in my app.php under the providers array. Does not work. Says that page could not be found.

Melodia started a new conversation Package Does Not Show On The Front-end

I try to create a package but for some reason I cannot access the front-end. This is my package structure, from the project root directory:

/package/contact/src/routes/web.php /package/contact/composer.json /package/contact/ContactServiceProvider

The service provider class looks like the following:

namespace Sidneylab\Contact;

use Illuminate\Support\ServiceProvider;

class ContactServiceProvider extends ServiceProvider
{
    public function boot(){

        $this->loadRoutesFrom(__DIR__.'/routes/web.php');

    }

    public function register(){
    }
}

Compsoer.json

"name": "sidneylab/contact",
"description": "This will send email to admin and send contact query to database",
"type": "library",
"license": "MIT",
"authors": [
    {
        "name": "Sidney de Sousa",
        "email": "[email protected]"
    }
],
"minimum-stability": "dev",
"require": {},
"autoload": {
    "psr-4": {
        "Sidneylab\Contact\": "src/"
    }
},

web.php

Route::get('contact', function(){
return "contact";
 });

In my main composer.json file I added this:

"autoload-dev": {
    "psr-4": {
        "Tests\": "tests/",
        "Sidneylab\Contact\": "package/contact/src"
    }
},

Now, when I hit my url/contact it does not return anything. Anything I could have possibly missed?

14 Nov
10 months ago

Melodia left a reply on How To Check If Different Users Belong To The Same Community

@DANIELRUBANGO - Unfortunately this site does not follow certain laravel best practice approach and there is only so much I can do to change everything

Melodia left a reply on How To Check If Different Users Belong To The Same Community

Unfortunately, the site is a mess and doesn't follow best laravel conventions. However, I had the following idea.

I can get the community_id of the community_users table which I belong

$community_user_member = DB::table('community_users')->whereUserId($user->id)->pluck('community_id')->toArray();

Then I do the same for te user I want to see the posts:

$requested_user = DB::table('community_users')->whereUserId($user_id)->pluck('community_id')->toArray();

I initially an empty aray:

$common = [];

Then I try to use the in_array function to obtain an array with all the community_id

    foreach ($community_user_member as $key => $member) {
        if (in_array($member, $requested_user)) {
            $common[] = $member;

        }
    }
    print_r($common);

The end result should be something like this:

$common = [ '4','5','10','20' ];

Because then I would be able to loop through $common array and do whatever I want.

But I get the following error when I refresh the page:

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
12 Nov
10 months ago

Melodia left a reply on How To Check If Different Users Belong To The Same Community

@DANIELRUBANGO - In general yes...but for this particular task am fetching the tables using DB.

Melodia started a new conversation How To Check If Different Users Belong To The Same Community

I have a table called communities, users, and community_users, and that table stores the user_id, as well as the community_id. Each user is or can be associated with multiple communities.

In this url, I pass a user_id

Route::get('/commoncommunityposts/{user_id?}', 'GolfPlayed\[email protected]');

The following is what I have in function for now which does not seem to make sense:

public function getCommonPostsByUser($user_id = null, Request $request)
{

    $user = $this->getAuthorizedUser($request->header('X-User-Auth-Token'));
    $user = User::find(22);
    if (!$user) {
        return response()->json(['error' => true, 'code' => 401, 'message' => INVALID_AUTH_TOKEN], 401);
    }

    $community_users = DB::table('community_users')->whereUserId($user->id)->get();

    foreach($community_users as $community){
        $check_user = DB::table('community_users')->whereUserId($user_id)->first(); 

        if(!empty($check_user)){
            return "You belong to the same community";
        }       
    }
}

I want to do whatever I need with the user that am fetching via url, as long as him and( $user->id) belong to the same community. How can I do that?

04 Nov
10 months ago

Melodia left a reply on My Post Method Not Working With Laravel-echo

Yes I do have an authenticated user. It's just the syntax in the vue side that is missing. I found typos but still wasnt all apparently:

export default {
    data(){
        return {
            project: {},
            newTask: ''
        }
    },
    created() {
        this.dataProject();        
    },
    methods: {

        save(){
            axios.post('/api/projects/${this.project.id}/tasks', {
                body: this.newTask
            })
            .then(response => response.data)
            .then(this.addTask);
        },
        addTask(task){
            this.project.tasks.push(task);

            this.newTask = '';
        },

        dataProject(){
            axios.get('/api/projects/${this.project.id}')
            .then(response => { 
                this.project = response.data;
                window.Echo.private('tasks. ' + this.project.id)
                    .listen('TaskCreated', ({task}) => this.addTask(task));
            });
        }
    }
}

It's unexpected token

app.js:53135 Uncaught SyntaxError: Unexpected token )

But I have no idea where else I should remove a bracket.

Melodia left a reply on My Post Method Not Working With Laravel-echo

I noticed that there was a missing brace, but still that didnt solve the issue and I see this error in the console:

 Uncaught Error: Module build failed: SyntaxError: C:/xampp/htdocs/laravel-echo/resources/assets/js/components/TaskList.vue: Unexpected token, expected , (43:8)

                  .listen('TaskCreated', ({task}) => this.addTask(task));

Melodia left a reply on My Post Method Not Working With Laravel-echo

@D9705996 I changed my script to this:

export default {
    data(){
        return {
            project: this.dataProject,
            newTask: ''
        }
    },
    created() {
        window.Echo.private('tasks. ' + this.project.id).
        listen('TaskCreated', ({task}) => this.addTask(task));
    },
    methods: {

        save(){
            axios.post('/api/projects/${this.project.id}/tasks', {
                body: this.newTask
            })
            .then(response => response.data)
            .then(this.addTask);
        },
        addTask(task){
            this.project.tasks.push(task);

            this.newTask = '';
        },

        dataProject(){
            axios.get('/api/projects/${this.project.id}')
            .then(response => { 
                this.project = response.data
            });
        }
    }
}

But still does work

Melodia left a reply on Pusher Notificiations Not Working

Aaaah yes. I had done that in one of the solutions attempt...had found it weird after running the queue worker because it was firing events as if it's an endless loop so I didnt really think that had saved the issue. Also interesting that I had tested the events on a fresh installation and never needed to run queue:work.

Melodia started a new conversation My Post Method Not Working With Laravel-echo

I was watching one of the tutorials for Laravel-echo but due to a very poor knowledge of vue.js I got lost along the way with private channels.

I created a projects and tasks table. All the relationship is created and below are my endpoints:

Route::get('/tasks', function(){
    return Task::latest()->pluck('body');
});

Route::get('/projects/{project}', function(Project $project){
    $project->load('tasks');
    return view('projects.show', compact('project'));
});

Route::get('/api/projects/{project}', function(Project $project){
    return $project->tasks->pluck('body');
});

Route::post('/api/projects/{project}/tasks', function(Project $project){
    $task = $project->tasks()->create(request(['body']));
    TaskCreated::dispatch($task);
    return $task;
});

Everything seems to be okay with my TaskCreated event:

public $task;

public function __construct($task)
{
    //
    $this->task = $task;
    $this->dontBroadcastToCurrentUser();
}

public function broadcastOn()
{
    return new PrivateChannel('tasks. ' .$this->task->project_id);// the id of the project
}

Now the issue comes in the vuejs:

<template>
    <div class="container">
        <ul>
            <li v-for="task in tasks" v-text="task"></li>
        </ul>
        <input type="text" v-model="newTask" @blur="addTask">
    </div>
</template>

<script>
    export default {
        data(){
            return {
                tasks: [],
                newTask: ''
            }
        },
        created() {
            axios.get('/tasks').then(response => (this.tasks = response.data));
            window.Echo.private('tasks. ' + this.project.id).listen('TaskCreated', e => {
                this.tasks.push(e.task.body);
            });
        },
        methods: {

            addTask(){
                axios.post('/api/projects/${this.project.id}/tasks', {
                    body: this.newTask
                })
                .then(response => {
                    this.showTasks();
                    this.newTask = '';
                })
            },
            showTasks(task){
                axios.get('/api/projects/${this.project.id}')
                .then(response => {
                    this.tasks = response.data.body
                })
            }
        }
    }
</script>

When I refresh the page on url/project/1 for example, I can see the task on that particular project. But if I enter another task and hit the tab key. Nothing happens.

Also I noticed the following error in the console when I refresh the page.

 Error in created hook: "TypeError: Cannot read property 'id' of undefined"

I want to be able to add a new task, and instantly have it updated in different browser where I have another user logged in.

Hope someone can help.

Thanks in advance

Melodia left a reply on Pusher Notificiations Not Working

I am not quite sure if it was cache, but suddenly everything works...pusher and log.

26 Oct
10 months ago

Melodia left a reply on Pusher Notificiations Not Working

This is how my controller looks like:

public function view_posts(){
    $user = User::find(6999);
    event(new TestNotification($user));
    return $user;       
}

And inside the TestNotification I initialized my constructor:

<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class TestNotification implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $user;

    public function __construct($user)
    {
        $this->user = $user;
    }

    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}

I changed the broadcast_driver to log. When refresh the url, I get the user, but nothing is added to my log.

25 Oct
10 months ago

Melodia left a reply on Pusher Notificiations Not Working

Thanks for the tip on the .env

Point is, regardless of broadcasting, when I call the event, I should be able to see something on pusher console area about that particular event. But for some reason I dont see anything.

if I call a post funtion

$post = Post::create($request->all());

PostNotification::dispatch($post);

$post variable would become public inside PostNotification event. When I create a new post, pusher should be able to show me the post that was just created.

Melodia left a reply on Pusher Notificiations Not Working

@D9705996 no need to worry about the .env. Those are just dummy content. Regarding the tutorial recommendation, thanks. However, the second tutorial would be what I would like to watch, because the problem is when I try to push to pusher.

my .env files were configured the same Jeffrey configured at Laracasts tutorial.

Hope someone can help.

24 Oct
10 months ago

Melodia started a new conversation Pusher Notificiations Not Working

I have function that adds people into a chat a group. That works. All I need to do now, is create an event that send a notification to each member that was added, that they were just added.

The method looks like this:

public function addGroupChatMember(Request $request, $id) {
    $user = $this->getAuthorizedUser($request->header('X-User-Auth-Token'));

    if (!$user) {
        return response()->json(['error' => true, 'code' => 401, 'message' => INVALID_AUTH_TOKEN], 401);
    }

    $validator = Validator::make($request->all(), [
        'user_ids' => 'required|array|min:1',
    ]);



    if ($validator->fails()) {
        return response()->json(['error' => true, 'code' => 400, 'message' => $validator->errors()]);
    }
    Connect::setAuthUserId($user->id);

    if ($participants = Connect::addConversationMember($id, $request->get('user_ids'))) {

        if(is_array($request->user_ids)){
            foreach($request->user_ids as $uId){
                event(new SendGroupChatMember($participants, $uId));    
            }               
        }
        else{
            event(new SendGroupChatMember($participants, $request->user_ids));  
        }

        return response()->json(['status' => 'success', 'message' => 'Add new member successfully', 'participants' => $participants], 200);
    }

    return response()->json(['error' => true, 'code' => 400, 'message' => 'Unable to add member to conversation']);
}

My SendGroupChatMember.php looks like this:

public $uId;
public $participants;

public function __construct($participants, int $uId = 0 )
{
    $this->uId = $uId;
    $this->participants = $participants;
}

public function broadcastAs()
{
    return 'new-group-chat-receive-event';
}

public function broadcastOn()
{
    $channel = 'golfplayed-new-group-chat';
    if(!empty($this->uId)) {
        $channel .= '-' . $this->uId;
    }
    return new Channel($channel);
}

For some reason, when I make the request, the event does not work. When I go to pusher console, I do not see anything about the even.

I followed the documentation on how to use pusher and everything is configured in .env file.

BROADCAST_DRIVER=pusher

PUSHER_APP_NAME=thename
PUSHER_APP_ID=262815
PUSHER_APP_KEY=3461161115151515a2e1
PUSHER_APP_SECRET=a24e8dd95b0aa14dvvdfvdd
PUSHER_APP_CLUSTER=us2

Is there anything else I need to do for pusher to work?

Melodia left a reply on Cannot Serialize Or Unserialize PDO Instances On Get Request

I actually just realized that if I dd($community), I do receive the community result.

However, If dd($post), I do receive a result

Melodia started a new conversation Cannot Serialize Or Unserialize PDO Instances On Get Request

For my api's, I want to notify the owner of a community everytime a comment is posted in a post that belongs to his community and my code looks like this, and the function looks like this:

public function communityPostComment(Request $request, $post_id) {
    $user = $this->getAuthorizedUser($request->header('X-User-Auth-Token'));
    $user = User::find(6999);
    if (!$user) {
        return response()->json(['error' => true, 'code' => 401, 'message' => INVALID_AUTH_TOKEN], 401);
    }

    //$text = $request->input('comment_text');
    $text = "This is my latest";

    if (is_null($text) || $text == '') {
        return response()->json(['error' => true, 'code' => 400, 'message' => 'No comment text submitted']);
    }

    try {
        if(0 && \App::environment('production-trigger')) {
            $insert = \DB::connection('trigger')->table('tbl_Community_Post_Comments')->insertGetId([
                'User_ID' => $user->id,
                'Post_ID' => $post_id,
                'Comment_Text' => $text,
                'Created_Date_Time' => Carbon::now()->format('Y-m-d H:i:s'),
                'Active' => 1,
            ]);
            $post = \DB::table('community_custom_posts')->wherePostId($post_id)->first();
            $community = Community::whereUserId($post->community_id);
            event(new SendPostCommentNotification($community, $user));

        } else {
            $insert = CommunityPostComment::insertGetId([
                'post_id' => $post_id,
                'user_id' => $user->id,
                'comment_text' => $text,
                'active' => 1,
                'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
            ]);
            $post = \DB::table('community_custom_posts')->wherePostId($post_id)->first();
            $community = Community::whereUserId($post->community_id)->get();
            event(new SendPostCommentNotification($community, $user));




        }
        return response()->json(['success' => true, 'code' => 200, 'comment_id' => $insert]);
    } catch (\PDOException $e) {
        return response()->json(['error' => true, 'code' => 400, 'message' => 'Unsuccessful comment attempt', 'error_message' => $e->getMessage()]);
    }
}

This is how my route looks like:

Route::get('post/comment/{post_id}', 'GolfPlayed\[email protected]')->where('post_id', '[0-9A-Za-z\-]+')->name('api.communityPostComment');

When I type this:

http://productionapi.local/post/comment/613

I get this in my response:

error_message   "You cannot serialize or unserialize PDO instances"

I have the feeling that the error is in this line:

$community = Community::whereUserId($post->community_id);

If I do dd($community) I a result though.

If I do this:

$community = Community::whereUserId($post->community_id)->get();

I dont receive anything.

Anything I am possibly doing the wrong way?

21 Oct
10 months ago

Melodia started a new conversation Schedule Command Not Working

I created a new command named: DeleteOfferCommand and it looks like this:

class DeleteOfferCommand extends Command
{

    protected $signature = 'app:delete-offer';

    protected $description = 'Delete expired offers';

    public function handle()
    {
        $offers = Offer::all();

        foreach($offers as $offer){

            if(now() >= $offer->expires_at){    
                $offer->delete();
            }
        }
    }
}

In the tutorial, I see that there is a folder called start which I should use to intiate the command:

Artisan::add(new DeleteOfferCommand);

However, I do not see that folder on my side, also checked laravel documentation and didnt see that instruction.

Moving on, I went to my forge account and created a new schedule which looks like the following:

php /home/forge/mysite.com/artisan app:delete-offer

If I ssh into the server and run the artisan command, I am able to see the command.

app:delete-offer     Delete expired offers

But when I go to my site, I do not see any effect.

The offer expired about an hour ago but It wasnt delete.

Anything I need to add to make my code work?

The offer expired about an hour ago but It wasnt delete.

In case needed, this is how I save the offer in my controller:

public function store(Request $request)
{
    $this->validate($request, [
        'offer_price' => 'required',
        'offer_period' => 'required',
        'offer_message' => 'required',
    ]);
    $expires_at = now()->addMinutes($request->offer_period);
    
            $this->validate($request, [
                'cash_amount' => 'required',
            ]);
            $offer = Offer::Create([
                'user_id' => Auth::id(),
                'property_id' => 2,
                'offer_price' => $request->offer_price,
                'offer_period' => $request->offer_period,
                'offer_message' => $request->offer_message,
                'cash_amount' => $request->cash_amount,
                'buyer_type' => $request->buyer_type,
                'expires_at' => $expires_at,
            ]);
}

Anything I need to add to make my code work?

13 Oct
11 months ago

Melodia left a reply on How Can I Make A More Refine Search Result

@D9705996 I followed your suggestion and it actually works now. Initialized all the variables and put a conditional statement in all the methods.

public function city_suburb($city = null){
    if(!$city) {
       return $this->builder;
    } 
    return $this->builder->where('city', $city)->orWhere('suburb', $city);
}

public function type($type = null){
    if(!$type) {
       return $this->builder;
    } 
    return $this->builder->where('type', $type);
}

public function min_price($price = 0){
    if(!$price) {
       return $this->builder;
    } 
    return $this->builder->where('price', '>=', $price);
}

 public function max_price($price = 0){
    if(!$price) {
       return $this->builder;
    } 
    return $this->builder->where('price', '<=', $price);
}

public function bathrooms($bathrooms = null){
    if(!$bathrooms) {
       return $this->builder;
    }       
    return $this->builder->where('bathrooms', $bathrooms);
}

public function bedrooms($bedrooms = null){
    if(!$bedrooms) {
       return $this->builder;
    }       
    return $this->builder->where('bedrooms', $bedrooms);
}

Melodia left a reply on How Can I Make A More Refine Search Result

Sounds a bit odd. I attempted to initialise the price to zero, but it complained about the other methods. So intialized everything to null. But now if I just search for type, it gives me an empty array.

public function type($type){
    return $this->builder->where('type', $type);
}

public function min_price($price = 0){
    return $this->builder->where('price', '>=', $price);
}

public function max_price($price = 0){
    return $this->builder->where('price', '<=', $price);
}

public function bathrooms($bathrooms = null){
    return $this->builder->where('bathrooms', $bathrooms);
}

public function bedrooms($bedrooms = null){
    return $this->builder->where('bedrooms', $bedrooms);
}

Melodia left a reply on How Can I Make A More Refine Search Result

I remember to have changed to that but it did not work. But I followed Jeffrey's tutorial and just trying to implement the way he explained.

All works, but only if I type the query in the url my self. If I user the form, it gives me this error:

 Too few arguments to function App\PropertyFilters::min_price(), 0 passed and exactly 1 expected

And the url converts into these:

http://owlcrest.local/search?city_suburb=&type=apartment&min_price=&max_price=&bedrooms=&bathrooms=

Which seems like all records are compulsory

My form looks like this:

{!! Form::open(['method' => 'GET', 'action'=>'[email protected]_page']) !!}
    <div class="row flex wrap">

        <div class="col-sm-10">
            <div class="search-input">
                {!! Form::text('city_suburb', null, ['class'=>'form-controla', 'placeholder'=>'Search for suburb']) !!}         
            </div>

            <div class="select-boxes">
                {!! Form::select('type', [''=>'Type of property'] + ['apartment'=>'Apartment', 'house'=>'House', 'plot'=>'Plot', 'smallholding'=>'Smallholding', 'commercial'=>'Commercial', 'townhouse'=>'Townhouse'], null, ['class'=>'form-']) !!}   

                {!! Form::select('min_price', [''=>'Minimum'] + [450000 => 'R 450 000', 5000000 => 'R 500 000', 1000000 => 'R 1 000 000',2000000 => 'R 2 000 000', 3000000 => 'R 3 000 000', 4000000 => 'R 4 000 000',5000000 => 'R 5 000 000', 6000000 => 'R 6 000 000',

], null, ['class'=>'form-']) !!} {!! Form::select('max_price', [''=>'Maximum'] + [450000 => 'R 450 000', 500000 => 'R 500 000', 1000000 => 'R 1 000 000',2000000 => 'R 2 000 000', 3000000 => 'R 3 000 000', 4000000 => 'R 4 000 000',5000000 => 'R 5 000 000', 6000000 => 'R 6 000 000', ], null, ['class'=>'form-']) !!} {!! Form::select('bedrooms', [''=>'Bedroom'] + [2=>'1+', 3=>'2+', 20=>'20+'], null, ['class'=>'form-']) !!} {!! Form::select('bathrooms', [''=>'bathroom'] + [2=>'1+', 3=>'2+', 20=>'20+'], null, ['class'=>'form-']) !!}

        <div class="col-sm-2">
            {!! Form::submit('Search', ['class'=>'search bg-brown']) !!}
            <button class="clear-filter button">Clear Filter</button>
        </div>                  
    </div>

{!! Form::close() !!}

My function in the search_page became like the one below:

public function search_page(PropertyFilters $filters)
{
   return Property::filter($filters)->get();
 
} 

PropertyFilters.php

class PropertyFilters extends QueryFilter
{

    public function type($type){
        return $this->builder->where('type', $type);
    }

    public function min_price($price){
        return $this->builder->where('price', '>=', $price);
    }

    public function max_price($price){
        return $this->builder->where('price', '<=', $price);
    }

    public function bathrooms($bathrooms){
        return $this->builder->where('bathrooms', $bathrooms);
    }

    public function bedrooms($bedrooms){
        return $this->builder->where('bedrooms', $bedrooms);
    }
}

QueryFilter.php

abstract class QueryFilter
{
    //
    protected $request;
    protected $builder;

    public function __construct(Request $request){
        $this->request = $request;
    }

    public function apply(Builder $builder){
        $this->builder = $builder;

        foreach($this->filters() as $name => $value){
            if(method_exists($this, $name)){
                call_user_func_array([$this, $name], array_filter([$value]));
            }
        }

        return $this->builder;
    }

    public function filters(){
        return $this->request->all();
    }
}

I guess this goes back to the question @Snapey asked previously: When a user enters different searches, are you wanting them to be AND (the reply must contain all the search terms) or OR (the reply contains any of the search terms).

So in this case the reply should only contain the the search terms.

Melodia left a reply on How Can I Make A More Refine Search Result

@D9705996 Yes I watched the tutorial and my code is based on the first minutes of that tutorial if you take a look at that. But it feels weird to follow the advanced when the basic is not working.

Melodia left a reply on How Can I Make A More Refine Search Result

@Snapey Yes I do have a price column.

The second url gives a result.

But now if I just type this:

http://owlcrest.local/search?max_price=200

It does not show valid data. I see properties that price are higher than 200

Melodia left a reply on How Can I Make A More Refine Search Result

So, I now changed my method to this:

public function search_page(Request $request)
{
    $property = (new Property)->newQuery();
   
    if($request->exists('suburb')){
        $property->whereSuburb($request->suburb);
    }

    if($request->has('max_price')){
        $property->where('price', '<=', $request->max_price);
    }

    return $property->get();
 
}  

But this is what happens: The below works:

http://owlcrest.local/search?suburb=Kenilworth

But the below does not really work:

http://owlcrest.local/search?max_price=200

It returns me properties which the price are even 1554511

And if I search for this:

http://owlcrest.local/search?suburb=Kenilworth?max_price=52954

It does not return anything, which is not really right.

Melodia left a reply on How Can I Make A More Refine Search Result

@Snapey I just changed my search:

  http://owlcrest.local/search?suburb=Kenilworth

But it still return all the properties from the table instead.

"When a user enters different searches, are you wanting them to be AND (the reply must contain all the search terms) or OR (the reply contains any of the search terms)."

The reply must contain any of the search term. Because I could search for a property by city only. Or could search property by city where min price is 200000dollars. Or I can just search for property by min price, and etc. Hope I managed to explain properly

"I don't know how you are sending kenilworth but it shouldn't have quotes around it? (those %22's)"

At the moment I am entering the url manually, just fo rtesting purposes.