sumitgroup

sumitgroup

Member Since 2 Months Ago

Experience Points
1,140
Total
Experience

3,860 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 1
1,140 XP
Apr
07
2 days ago
Activity icon

Started a new Conversation How To Display Data Value According To Dropdown In Laravel?

I have a table in my database which has a field lis_type and this (lis_type) field has 2 values sale and rent, and I am calling data on my view page. Suppose I click on Sale page then there should be shown only sale similar listing and if I click on Rent then similar listing should be shown for rent. But right now both listings are coming together, Please let me guide where I am mistaking.

Here is my Controller code...

public function listingshownow(Request $r,$slug)
    {
   $listview= Listing::where('slug',$slug)->first();
    $products = Listing::where('propId',$listview->propId)
   ->where(function ($query) {
    $query->where('lis_type', '=','sale')->orWhere('lis_type','=', 'rent');
    })->get();
   return view('listings-view', compact('products'));
    }

and here are my view file Where I am displaying data... For Similar Listings...

@foreach($products as $prod)
    @if($prod->lis_type=='sale')
    <div class="row featured portfolio-items">
     <div class="col-lg-7 col-md-12 homes-content pb-0 mb-44">
    <ul class="homes-list clearfix">
    <li>
     <i class="fa fa-bed" aria-hidden="true"></i>
     <span>{{$prod->ls_fs}}</span>
     </li>
     <li>
     <i class="fa fa-bath" aria-hidden="true"></i>
     <span>{{$prod->bathroom}} Bathroom</span>
     </li>
     </ul>
      </div>
     </div>
      @endif
       @endforeach
Mar
25
2 weeks ago
Activity icon

Started a new Conversation Error In Data Import From Excel In Laravel 6?

I am getting error when i am Importing data from Excel Sheet, I am doing it by Controller. and I am getting this error Call to undefined method Maatwebsite\Excel\Excel::load()

Please let me know if it can be possible by Model,....

Here are my Model..

  <?php
      namespace App;
      use Illuminate\Database\Eloquent\Model;
      class Lead extends Model
     {
protected $primaryKey = 'lId';
    }

Here are my Controller Code...

 public function import(Request $request){
    $this->validate($request, [
        'select_file' => 'required|mimes:xls, xlsx'
    ]);
    $path=$request->file('select_file')->getRealPath();
    $data=Excel::load($path)->get();
    if($data->count() > 0)
    {
        foreach ($data->toArray() as $key => $value) 
        {
            foreach($valuse as $row)
            {
                $insert_data[]=array(
                    'Name'=>$row['name'],
                    'Project'=>$row['project'],
                    'Follow up Date'=>$row['followup'],
                    'Lead Source'=>$row['lead_source'],
                    'Email Id'=>$row['email'],
                    'Message'=>$row['message'],
                    'Phone Number'=>$row['number'],
                    'Status'=>$row['status'],
                );
            }
        }
        if(!empty($insert_data))
        {
            DB::table('leads')->insert($insert_data);
        } 
    }
    return back()->with('success', 'Excel Data Imported successfully.');
}

and here are my view code...

<form action="{{ route('import') }}" method="POST" enctype="multipart/form-data">
								@csrf
								<input type="file" name="select_file" class="form-control">
								<br>
								<input type="submit" name="upload" class="btn btn-primary" value="Upload">
							</form>

Here are my routes..

    Route::post('lead/import', '[email protected]')->name('import');
Mar
23
2 weeks ago
Activity icon

Replied to How To Display Total Click Values In Laravel?

@snapey If I see an item and press refresh 5 times, then it should be count 5 times on my view page.

Activity icon

Started a new Conversation How To Display Total Click Values In Laravel?

I want to count the total click values in laravel, Just like as Laracates. When someone ask question here then it shows the total views value. I want process like this. Please let me guide how i can do it. Does i need to store the values in Database.

Activity icon

Started a new Conversation How To Count Value According To Date In Laravel?

I have multiple fields store in my database table, and there are followup field in my database and there are multiple dates store in this field. Now i want count data according to current date. But i am unable to do it. Please let me know how i can do it.

Here are my controller code..

 public function index()
{
    $lead=Lead::orderBy('created_at', 'desc')->get()
    return view('admin.lead.index',compact('lead'));
}

and here are my view file..

<div class="panel-heading">
	@php
	$mytime = Carbon\Carbon::now();
	$checkdate=$mytime->toDateTimeString();
	@endphp
	<div class="panel-title">Today Follow Up's: 
		@foreach($lead as $lws)
			<span class="label label-warning">
				{{($lws->followup=$checkdate)}}
			</span>
		@endforeach
	</div>
	</div>

I am getting same data multiple times, but i want in this format (Suppose there are 5 date store according to today date and they should be count 5, so that i can get the today followup clients )

Mar
16
3 weeks ago
Activity icon

Replied to How To Get Current Page Title In Laravel?

i solve this issue using with

public function listtype($slug){
$prtype= Listing::whereHas('proType',function($q) use($slug){
    $q->where('slug','like','%'.$slug.'%');
})->with('proType')->paginate(50);
Activity icon

Replied to How To Get Current Page Title In Laravel?

@snapey yes, i want to get the title from proType model table.

Activity icon

Replied to How To Get Current Page Title In Laravel?

Hi @rameezisrar i want to display the title of proType table, and i have multiple projects on property-view page.

Activity icon

Started a new Conversation How To Get Current Page Title In Laravel?

i have some fields in my database table, and i want to display title,description and keywords according to every page, Please let me know how i can display this. My database fields name are metatitle,metadesc,keyword

Here are my Controller code where i am displaying the property list...

 public function listtype($slug){
    $prtype= Listing::whereHas('proType',function($q) use($slug){
        $q->where('slug','like','%'.$slug.'%');
    })->paginate(50);
    return view('property-type',compact('prtype','title'));
}
Mar
13
3 weeks ago
Activity icon

Started a new Conversation How To Get Current Project Value On Click In Laravel Form?

I have multiple projects list on a single page, and each project have a send query button. When i am clicking on send query button then i am getting name, email, phone on mail, but i want something like this, when someone click on send query button then current click project name should be append in form and i will get the information by mail.

Here are my HTML Button Code...

<a href="javascript:void()">
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal">Send Query</button>
     </a>

and here are my form data..

	<div class="modal fade" id="myModal" role="dialog" style="margin-top: 100px;">
<div class="modal-dialog">
	<!-- Modal content-->
	<div class="modal-content">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">&times;</button>
			<h4 class="modal-title">Send Query For Rent</h4>
		</div>
		<div class="modal-body">
			<form class="form-horizontal" action="{{url('/send_Your_mail')}}" method="post">
				@csrf
				<div class="form-group">
					<div class="col-sm-12">
						<input type="text" class="form-control" id="user_name" placeholder="Enter Your Name" name="user_name" required>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-12">
						<input type="email" class="form-control" id="user_email" placeholder="Enter Yorm E-mail" name="user_email" required>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-12">          
						<input type="number" class="form-control" id="user_phone" placeholder="Enter Your Phone" name="user_phone" required>
					</div>
				</div>
				<input type="hidden" name="prop_name" value="prop_name">
				<div class="form-group">        
					<div class="col-sm-offset-2 col-sm-12">
						<button type="submit" class="btn btn-primary">Submit</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

and here are my controller code...

public function send_Your_mail(Request $r)
  {
$validator = Validator::make($r->all(), [
    'user_name' => 'required',
    'user_email' =>'required',
    'user_phone' =>'required',
]);
if ($validator->fails()) {
    return redirect()->back()->withErrors($validator);
}
$data=[
    'user_email'=>$r->user_email,
    'user_name'=>$r->user_name,
    'user_phone'=>$r->user_phone,
    'user_desc'=>$r->user_desc,
];
Mail::send('mail', $data, function($message) use($data)
{
    $message->from($data['user_email'], 'Email Form sumit');
    $message->to('[email protected]');
    $message->subject($data['user_desc']);
});
return redirect()->back()->with('message','Thanks for Choosing us.');
 }
Mar
12
4 weeks ago
Activity icon

Started a new Conversation How To Redirect Old-URL To New-URL In Laravel 6?

I just change my website all url's and now my old url is showing on google index. When i am searching any keyword then my previous links are showing there. suppose my old url is https://example.com/elans-town-commercial-project-for-sale and now new url is https://example.com/elans-town-for-sale. Please let mw know how i can permanent redirect my all urls to new urls. Because i don't want to remove my old URL's by google webmaster tools.

Mar
05
1 month ago
Activity icon

Started a new Conversation How To Solve Slider Issue Using Foreach In Laravel?

I am working on a slider, everything is working fine but slider next and previous button not working. When i click on thumb images then it's also not working. Please let me know where i am mistaking.

Here are my slider view Code..

	       <div id="listingDetailsSlider" class="carousel listing-details-sliders slide mb-30">
            <h5 class="mb-4">{{$prop->title}} {{$prop->proLocation->locations}} {{$prop->proCity->name}}</h5>
            <div class="carousel-inner">
             <div class="active item carousel-item" data-slide-number="0">
              @forelse($prop->proImage as $sliderimage)
              <img src="{{asset('property_img/'. $sliderimage->large_thumb_url.'/'. $sliderimage->large_thumb)}}" class="img-fluid" alt="slider-listing" style="width: 965px; height: 500px;">
              @empty
              @endforelse
            </div>
            <a class="carousel-control left" href="#listingDetailsSlider" data-slide="prev"><i class="fa fa-angle-left"></i></a>
            <a class="carousel-control right" href="#listingDetailsSlider" data-slide="next"><i class="fa fa-angle-right"></i></a>
          </div>
          
          <!-- main slider carousel nav controls -->
          <ul class="carousel-indicators smail-listing list-inline nav nav-justified">
            @forelse($prop->proImage as $sliderimage)
            <li class="list-inline-item active">
              <a id="carousel-selector-0 {{ $loop->first ? 'active' : '' }}" class="selected" data-slide-to="0" data-target="#listingDetailsSlider">
                <img src="{{asset('property_img/'. $sliderimage->small_thumb_url.'/'. $sliderimage->small_thumb)}}" class="img-fluid" alt="listing-small" style="width: 127px; height: 85px;">
              </a>
            </li>
            @empty
            @endforelse
          </ul>
          <!-- main slider carousel items -->
        </div>
Mar
04
1 month ago
Activity icon

Started a new Conversation Getting Error In Search Filter In Laravel 6?

I am getting error in my search filter, everything is working fine but when i am searching by project Type, Select Status and Search by Project name then it's showing 0 results. But if i am not selecting any drop down fields it's working perfect. Please let me know where is the mistake.

Note: If i select and drop down fields and then enter project name then it's showing 0 results. Both drop down working fine without search bar.

here are my route...

Route::match(['get', 'post'], '/filter','[email protected]')->name('property.filter');

Hera are my controller code....

public function searchProperty(Request $r)
      {
$cat=$r->category;
$possession= $r->consStatus;
$prop_name= $r->prop_name;
prop=Listing::latest()
        ->when($prop_name, function($q) use($prop_name){
          return $q->whereHas('property.listing', function($sq) use($prop_name){ 
            $sq->where('prop_name', "like", "%" .$prop_name. "%");
          });
        })
->when($cat, function($q) use($cat){
          return $q->whereHas('property.listing', function($sq) use($cat){ 
            $sq->where('category', "like", "%" .$cat[0]. "%");
            for ($i=1; $i<count($cat); $i++) {
              $sq->orWhere('category', "like", "%" .$cat[$i]. "%");
            }
          });
        })
->when($possession, function($q) use($possession){
          return $q->whereHas('property.proDetail', function($sq) use($possession){ 
            $sq->where('possession', "like", "%" .$possession[0]. "%");
            for($i=1; $i<count($possession); $i++){
             $sq->orWhere('possession', "like", "%" .$possession[$i]. "%");
           }
         });
        })
->without('builder')
    ->paginate('100');

Herea are my view code..

    <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
      <form class="hero__form v1 filter listing-filter" id="filterForm1" method="POST" action="{{route('property.filter')}}">
        @csrf
        <div class="row">
          <div class="col-xl-2 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
            <select class="hero__form-input  custom-select" name="category[]" id="idPropertyType">
              <option>Project Type</option>
              <option value="Residential">Residential</option>
              <option value="Commercial">Commercial</option>
            </select>
          </div>
          <div class="col-xl-2 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
            <select name="consStatus[]" class="hero__form-input  form-control custom-select">
              <option value="">Select Status</option>
              <option value="Under Construction">Under Construction</option>
              <option value="Ready To Move">Ready To Move</option>
            </select>
          </div>
          <div class="col-xl-5 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
           <div class="input-search">
            <input type="text" name="prop_name" placeholder="Search by Project Name.." id="search_field place-event" onkeyup="getSearchResult1(this.value)" autocomplete="off">
            <input type="hidden" name="lstId">
            <input type="hidden" name="prop_name">
            <!-- <input type="hidden" name="ls_fs"> -->
            <input type="hidden" name="suggestion">
            <div class="dropdwonlist">  
              <ul class="list-group" id="suggetResult1">               
              </ul>
            </div> 
          </div>
        </div>
        <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
          <div class="submit_btn">
            <button class="btn v3" type="submit">Search</button>
          </div>
        </div>
      </div>
    </form>
  </div>
Feb
27
1 month ago
Activity icon

Started a new Conversation How To Remove Already Open Project From Similar Project In Laravel?

I have some property which is belongs to the open project locality, i am showing there related property which is available in that particular locality, everything is working fine but i don't want to show the property which is already open. I want top remove that property from related property....

Here are my code...

    $listview= Listing::where('slug',$slug)->first();
    $localityId=$listview->property->proLocality->lotId;
   $products2 = Listing::whereHas('property', function($q) use ($localityId, $listview){
    $q->where('lis_type',$listview->lis_type)->where('ls_fs','=',$listview->ls_fs)->where('subcategory',$listview->subcategory)->where('lotId',$localityId);
  })->get();

I dont what to show $listview property in products2 listings (Where products2 are showing related property)...

Feb
26
1 month ago
Activity icon

Started a new Conversation How To Get Data From Table, And Display In Search Bar After Type Column Name?

I have some data stored in my database table, and i want to fetch that data. I have a search engine on my website homepage. If someone search by project name in the search bar then list will be open in dropdown. and then i will submit after click on project name. If you have any reference then please let me know.

Activity icon

Started a new Conversation How To Change Form After Click Tabs In Jquery?

I have 3 forms, when i click on buy then form1 data should be display, if i click on another rent then form2 data should be show, if i click on project tab then form3 data should be show. Please let me know how i can do it.

Here are the code...

<ul class="nav nav-tabs hero_list">
      <li class="nav-item" id="buy">
        <a data-toggle="tab" href="#all_property" class="all_property">Buy</a>
      </li>
      <li class="nav-item" id="rent">
        <a data-toggle="tab" href="#for_rent" class="">Rent</a>
      </li>
      <li class="nav-item active" id="project">
        <a data-toggle="tab" href="#for_sale" class="active show">Project</a>
      </li>
    </ul>

Here are the form which need to be display after click on tabs...

    <form class="hero__form v1 filter listing-filter form1" id="filterForm" method="POST" action="      {{route('filter.property')}}" >
</form>
    <form class="hero__form v1 filter listing-filter form2" id="filterForm1" method="POST" action="     {{route('filter.property1')}}" >
    </form>
<form class="hero__form v1 filter listing-filter form3" id="filterForm2" method="POST" action="     {{route('filter.property2')}}" >
    </form>
Feb
25
1 month ago
Activity icon

Started a new Conversation Error In Drop Down Filter In Laravel?

I am trying to filter data from 2 dropdown, but when i selecting 'project typethen it's filter correctly, but if i am selectingstatusand 'project type together, then it's not filtering.

here are my controller code..

public function homefilter(Request $r){
  $propCat= $r->propCat;
  $possession= $r->consStatus;
 $prop = Property::active()
  ->when($possession, function($q) use($possession){
    return $q->whereHas('proDetail', function($sq) use($possession){ 
        $sq->where('possession', "like", "%" .$possession[0]. "%");
        for($i=1; $i<count($possession); $i++){
           $sq->orWhere('possession', "like", "%" .$possession[$i]. "%");
       }
   });
})
  ->when($propCat, function ($q) use ($propCat) {
    return $q->where(function ($sq) use ($propCat) {
        $sq->whereHas('proCat', function($sq) use($propCat){
            $sq->where('catId', 3)
            ->where('subCatId', $propCat);
        });
    });
  })
 ->without('builder')
->paginate('15');
 return view('search', compact('prop','allCategory','cities','req'));

And here are my view code...

<form class="hero__form v1 filter listing-filter" id="filterForm" method="POST" action="{{route('filter.property')}}">
      @csrf
 <div class="col-xl-2 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
          <select name="consStatus[]" class="hero__form-input  form-control custom-select">
            <option value="">Select Status</option>
            <option value="Under Construction">Under Construction</option>
            <option value="New Launch">New Launch</option>
            <option value="Ready To Move">Ready To Move</option>
          </select>
        </div>
        <div class="col-xl-2 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
          <select class="hero__form-input  custom-select" name="propCat[]">
            <option>Project Type</option>
            @foreach($allCategory as $sCat)   
            <option value="{{ $sCat->subCatId }}">{{ $sCat->cat_name }}</option>
            @endforeach
          </select>
        </div>
<div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 py-3 pl-30 pr-0">
<div class="submit_btn">
            <button class="btn v3" type="submit">Search</button>
          </div>
</div>
</form>
Feb
22
1 month ago
Activity icon

Replied to How To Get Count Values In Laravel From Database?

@snapey

Thank You so much Snapey, it's working perfect.

Activity icon

Started a new Conversation How To Get Count Values In Laravel From Database?

I am trying to display the total property from my database, All total property counting good, but the main issue is with Category wise. There are a column in my database lis_type and there are two category stored rent and sale, now i want to count sale and rent property. But i am getting error in counting.

ERROR Display: count(): Parameter must be an array or an object that implements Countable

Here are my code...

     public function index()
     {
   $listing=Listing::orderBy('created_at', 'desc')->get();
   return view('listings.index', compact('listing'));
     }

View Code:

   <button type="button" class="btn btn-danger btn-labeled-right rounded">
                            {{count($listing)}} &nbsp; Total Property
                        </button>
<button type="button" class="btn btn-success btn-labeled-right rounded">
                            {{count($listing->lis_type="sale")}} &nbsp; Sale
                        </button>
<button type="button" class="btn btn-info btn-labeled-right rounded">
                            {{count($listing->lis_type="rent")}} &nbsp;   Rent
                        </button>
Feb
21
1 month ago
Activity icon

Replied to How I Can Filter The Price From Two Column In Laravel 6?

@bugsysha it's not filtering the correct value, when I am click under 60 Lac, then it's filtering the projects which is above of 60 Lac.

Activity icon

Started a new Conversation How I Can Filter The Price From Two Column In Laravel 6?

I am getting error in filters, i have 2 columns in my database, one is minprice and another is maxprice and now i want to filter data from these 2 columns. Suppose i want price between 1000000-6000000 then it should be show the exact values between these prices. I have already written a a code for this but i am not understanding where i am mistaking.

Here are my controller code...

public function homefilter(Request $r){
  $minPrice= $r->minPrice;
  $maxPrice= $r->maxPrice;
  if($r->price_range){
    $price_range = explode('-', $r->price_range);
    $minPrice= $price_range[0];
    $maxPrice= $price_range[1];
}
 $prop = Property::active()
  ->when($minPrice, function($q) use($minPrice,$maxPrice){
    return $q->whereHas('proDetail', function($sq) use($minPrice,$maxPrice){
        $sq->where([
            ['minprice','>=', $minPrice],
            ['maxprice','<=', $maxPrice]
        ]);
    }); 
})  
->without('builder')
 ->paginate('15');
return view('search', compact('prop','allCategory','cities','req'));
 }

and here are my view file data...

  <div class="panel-body">
                                                <ul class="list-group">
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="1000000-6000000">Under 60 Lac</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="6000000-8000000">60 -80 Lac</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="8000000-10000000">80 - 1 Cr.</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="10000000-15000000">1 - 1.50 Cr.</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="15000000-20000000">1.50 - 2 Cr.</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="20000000-25000000">2 -2.5 Crore</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="25000000-30000000">2.5 - 3 Crore</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="30000000-50000000">3 - 5  Crore</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="50000000-100000000">5 - 10 Crore</li>
                                                    <li class="list-group-item-filter"><input type="checkbox" name="price_range" value="50000000-100000000">10 Crore +</li>                                     
                                                </ul>
                                            </div>
Feb
20
1 month ago
Activity icon

Started a new Conversation How I Can Make Page View Count Functionality In Larvel?

I want to make page view count in laravel, suppose if someone visit on my page then it will be count in 1 view and if the same user reload the page then it would be count in another view. Please let me guide how i can do it in Laravel.

Feb
19
1 month ago
Activity icon

Replied to Error In Laravel 6 Filter

I was not using value="", this was the exact error...

    @foreach($locality as $localt)
         <option value="">Select Locality</option>
         <option value="{{$localt->lotId}}">{{$localt->name}}</option>
    @endforeach
Activity icon

Replied to How To Remove Previous Search Result From Search Bar In Laravel 6?

@sti3bas I solve this issue using autocomplete="off" in input box..

<input type="text" name="title" placeholder="What are you looking for?" style="padding:13px; width: 343px;border: none;" id="search_field" onkeyup="getSearchResult(this.value)" autocomplete="off">
Activity icon

Replied to How To Remove Previous Search Result From Search Bar In Laravel 6?

@sti3bas

Please find the code...

$("#suggetResult").on('click','li',function (){
var searchtext = $(this).text();
var propId = $(this).data('propid');
var location = $(this).data('location');
var cityId = $(this).data('cityid');
var title = $(this).data('stitle');
var suggestion = $(this).data('suggestion');
        // alert(cityId);           
        $('#search_field').val(searchtext);
        $('input[name="locationId"]').val(location);
        $('input[name="sCityId"]').val(cityId);
        $('input[name="sPropId"]').val(propId);
        $('input[name="sTitle"]').val(title);
        $('input[name="suggestion"]').val(suggestion);
        
    });


 function getSearchResult(searchText){
    if(searchText.length >= 1){
        $.ajax({
            type:'POST',
            url: "{{url('suggestion-list')}}/"+searchText,                  
            dataType: 'JSON',
            headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}

        }).done(function(res) {
            $('#suggetResult').empty();
            $('#suggetResult').css({"height":"200px","overflow-x": "hidden",
                "overflow-y":"auto","position":"relative","z-index":"9"});
            if(res.status == 1)
                $.each(res.data,function(i,f){
                    $('#suggetResult').append('<li class="list-group-item" data-propId="'+f.propId+'" data-location="'+f.location+'" data-cityId="'+f.city+'" data-sTitle="'+f.title+'" data-suggestion="1">'+f.title+','+f.pro_location.locations+','+f.pro_city.name+'</li>');
                });
            else
                $('#suggetResult').html('Result not found on this parameter');
        }).fail(function(jqXHR, textStatus, status ) {
            alert(textStatus);          
        });
    }else{
        $('#suggetResult').empty();
    }
}
Activity icon

Started a new Conversation How To Remove Previous Search Result From Search Bar In Laravel 6?

When i am search new product in my search bar, it's showing already searches product, due to this i am unable to search the exact product. Please let me know how i can remove previous searches data from my search form.

here are my code...

  <div class="form-group looking">
        <div class="first-select wide">
          <div class="main-search-input-item">
            <input type="text" name="title" placeholder="What are you looking for?" style="padding:13px; width: 343px;border: none;" id="search_field" onkeyup="getSearchResult(this.value)">
            <input type="hidden" name="locationId" >
            <input type="hidden" name="sCityId" >
            <input type="hidden" name="sPropId" >
            <input type="hidden" name="sTitle" >
            <input type="hidden" name="suggestion" value="0">
            <div class="dropdwonlist">  
              <ul class="list-group" id="suggetResult">               
              </ul>
            </div> 
          </div>
        </div>
      </div>
Activity icon

Replied to Laravel - Display Only 3 Records From Relationship

@ziben69 Remove get() from your code and try to using this code $q->where('visible', 1)->orderBy('order', 'asc')->take(3);

Activity icon

Started a new Conversation Error In Laravel 6 Filter

Hi, I am trying to filter data in Laravel, Everything is working fine, but when i add "Select Locality" and "Select Status" then it does not show any data, reason because it's search in "Select Locality" and "Select Status" field. Could you please tell me how i can Display these option values.

Note: Main error is when i am adding these extra fields "Select Locality" and " Select Status"

Here are my code..

 <div class="trip-search">
         <form id="filterForm" method="POST" action="{{route('filter.property')}}">
          @csrf
          <div class="form-group location">
            <select name="lotId[]" class="nice-select form-control wide" tabindex="0">
             @foreach($locality as $localt)
             <option>Select Locality</option>
             <option value="{{$localt->lotId}}">{{$localt->name}}</option>
             @endforeach
           </select>
         </div>
         <div class="form-group duration">
          <select name="consStatus[]" class="nice-select form-control wide" tabindex="0">
           <option>Select Status</option>
           <option value="Under Construction">Under Construction</option>
           <option value="New Launch">New Launch</option>
           <option value="Ready To Move">Ready To Move</option>
         </select>
       </div>
       <div class="form-group looking">
        <div class="first-select wide">
          <div class="main-search-input-item">
            <input type="text" name="title" placeholder="What are you looking for?" style="padding:15px;" id="search_field" onkeyup="getSearchResult(this.value)">
            <input type="hidden" name="locationId" >
            <input type="hidden" name="sCityId" >
            <input type="hidden" name="sPropId" >
            <input type="hidden" name="sTitle" >
            <input type="hidden" name="suggestion" value="0">
            <div class="dropdwonlist">  
              <ul class="list-group" id="suggetResult">               
              </ul>
            </div> 
          </div>
        </div>
      </div>
      <div class="form-group button">
        <button type="submit" class="btn">Search</button>
      </div>
    </form>
  </div>
Feb
17
1 month ago
Activity icon

Replied to How I Can Delete Previous Image When Update In Laravel 6?

@snapey Thank You so much...You Solved my Issue..This is the perfect answer

Activity icon

Replied to How I Can Delete Previous Image When Update In Laravel 6?

@tisuchi How i will get the existing file details...Here is my edit view code..

<div class="col-sm-9"> @if ("builders_img/{{ $builder->bldlogo }}") <img src="{{ asset('builders_img/'.$builder->bldlogo) }}"> @else No Image Found @endif <input type="file" name="bllogo" id="bllogo" value="{{$builder->bldlogo}}"> </div>

Activity icon

Replied to How I Can Delete Previous Image When Update In Laravel 6?

@tisuchi I am not getting previous file updated path, it's showing new updated file path.

Activity icon

Replied to How I Can Delete Previous Image When Update In Laravel 6?

i already checked this code, but still it's not working

Activity icon

Started a new Conversation How I Can Delete Previous Image When Update In Laravel 6?

Hi All, I am trying to update new images, but when i edit my form and select new image then previous image not deleting from my folder, Please let me know where i am mistaking. Here are my image update data...

public function update(Request $request, $builder)
{
$bld = Builder::findOrFail($builder);
$chr  = substr($request->bname, 0, 1);
        if( $request->hasFile('bllogo')){ 
    $thums= $request->bllogo;
        $bllogo = uniqid($chr).'.'.$thums->getClientOriginalExtension();
        $img = Image::make($thums->getRealPath());
        $img->resize(300, null, function ($constraint) {
            $constraint->aspectRatio();          
        });
        $thumbPath = public_path().'/builders_img/'.$bllogo;
         if (file_exists($thumbPath)) { // unlink or remove previous image from folder
            unlink($thumbPath);
        }
 $img->save($thumbPath);
        $optimizerChain = OptimizerChainFactory::create();
        $optimizerChain->optimize($thumbPath);
        $bllogoimg = $bllogo;

    }else{
        $bllogoimg = NULL;
    }
    $bld->name =$request->bname;
    $bld->slug =$request->bslug;
    $bld->title =$request->metatitle;
    $bld->short_desc =$request->metadesc;
    $bld->meta_desc =$request->metadesc;
    $bld->keyword =$request->metakeyword;
    $bld->bldlogo =$bllogoimg;
    $bld->save();
    return response()->json(['status'=>1], 201);
}
Jan
22
2 months ago
Activity icon

Started a new Conversation How To Filter Data Using Ajax In Laravel From Single Table?

Hi, I have a (listings) table in my database, and it's belongsTo (properties) table. Now i want to filter data from this (listings) table, please let me know how i can filter data using AJAX.

This is my Propertcontroller.php file

public function searchProperty(Request $r) { $trans=$r->transType; $list=Listing::where('lstId', '>', 30)->orWhere('transaction_type', 'Resale')->get(); dd($list); return view('listings', compact('list')); }

Route.php

Route::match(['get','post'], '/filter','[email protected]')->name('property.filter');

listings.blade.php

  • New Booking
  • Resale