NadeemAkhter

NadeemAkhter

Member Since 1 Year Ago

Experience Points 1,500
Experience
Level
Lessons Completed 1
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

27 Sep
1 month ago

NadeemAkhter left a reply on Laravel Paginate Links Not Work

@Cruorzy Thanks for your reply

This is my controller and Model Code

 public function searchFeaturedCarsByAllFilters(Request $request)
   {
       
    $filters = [];
    
    if ($request->has('city')) 
    {
        if($request->city!=-1)
        {
            $filters['cities'] = $request->city;
         
        }
    }
    if ($request->has('engine_type')) {
      $filters['engine_types'] = $request->engine_type;
    }
    if($request->has('make'))
    {
       if($request->make!=-1){
          $filters['brands'] = $request->make;
                }
            
    }
    if($request->has('model'))
    {
         if($request->model!=-1){
              $filters['models'] = $request->model;
                }
            
    }
    if($request->has('city_area'))
    {
      $filters['city_areas']=$request->city_area;
    }
    if($request->has('version'))
    {
      $filters['model_verions']=$request->version;
    }
    if($request->has('body_type'))
    {
      $filters['vehicle_body_types']=$request->body_type;
    }
    if($request->has('color'))
    {
      $filters['colors']=$request->color;
    }
    if($request->has('reg_city'))
    {
      $filters['registration_cities']=$request->reg_city;
    }
  
    
    $all_cars = $this->vehicle->searchFeaturedCarsByAllFilters($filters);
   
    
    
     
     $city_vehicles_count=$this->city->getAllCityFeaturedVehicles(\App\VehicleType::Car);
      
        $manufacture_featured_cars=$this->manufacture->getAllManufacturesFeaturedVehicles(\App\VehicleType::Car);
        
        
        
        //////////////////////////////////////////////////////////////////////////////////////
      /////////////////////////////////SEARCH FORM//////////////////////////////////////
     
       
      $model_year=ModelYear::orderby('year','asc')->get();
      $transmission= Transmission::all();
      $assembly= Assembly::all();
      $engine_type= EngineType::all();
      $color=Color::all();
      $reg_city= RegistrationCity::all();
      $body_type= VehicleBodyType::where('vehicle_type_id', VehicleType::Car)->get();
      $make=$this->manufacture->getAllManufacturerByType(VehicleType::Car);
      $city=City::all();
      

        return view('website/Carpages.featured-cars',compact('updated_date','model_year','city','make','manufacture_cars','images','most_featured_cars','transmission','assembly','engine_type','color','reg_city','body_type','all_cars','city_vehicles_count','manufacture_featured_cars','reg_cities','transmissions','engine_types','assemblies','colors','body_types','models'));
   
    }

public function searchFeaturedCarsByAllFilters(array $filters =[])
    {
      

       $query = DB::table('vehicles');

    foreach ($filters as $this->col => $this->id) {
      if($this->col=="price_fr")
      {
        $query=$query->Where('vehicles.price','>=', $this->id);
      }
      else if($this->col=="price_to")
      {
        $query=$query->Where('vehicles.price','<=', $this->id);
      }
      else if($this->col=="mileage_fr")
      {
        $query=$query->Where('vehicles.mileage','>=',$this->id);
      }
      else if($this->col=="mileage_to")
      {
        $query=$query->Where('vehicles.mileage','<=',$this->id);
      }
      else if($this->col=="capacity_fr")
      {
        $query=$query->Where('vehicles.engine_capacity','>=',$this->id);
      }
      else if($this->col=="capacity_to")
      {
        $query=$query->Where('vehicles.engine_capacity','<=',$this->id);
      }
      
      else if($this->col=="condition")
      {
         $query->Where(function ($query) {
          foreach ($this->id as  $id1)
          {
            $query=$query->orwhere('vehicles.condition', $id1);
          }
            });
          
      }
     
      
      else
      {
        
           $query= $query->Where($this->col. '.id', $this->id);
         
    }
      
     
    }


    $query->where([['vehicles.featured',1],['vehicles.isDeleted','false'],['images.size','s'],['status','approved'],['vehicles.vehicle_type_id',\App\VehicleType::Car]])
      
       ->join('vehicle_types','vehicle_types.id','=' , 'vehicles.vehicle_type_id')
      ->join('manufactures','manufactures.id' , '=' , 'vehicles.manufacture_id')
      ->join('brands','brands.id','=','manufactures.brand_id')
      ->join('models','models.id' , '=' , 'vehicles.model_id')
      ->join('vehicle_body_types','vehicle_body_types.id','=','models.bodytype_id')
      ->join('model_versions','model_versions.id','=','vehicles.model_version_id')
      ->join('cities','cities.id' , '=' , 'vehicles.city_id')
      ->join('city_areas','city_areas.id','=','vehicles.city_area_id')
      ->join('images','images.post_id' , '=' , 'vehicles.id')
      ->join('transmissions','transmissions.id','=','vehicles.transmission_id')
      ->join('assemblies','assemblies.id','=','vehicles.assembly_id')
      ->join('model_years','model_years.id','=','vehicles.model_year_id')
      ->join('engine_types','engine_types.id','=','vehicles.engine_type_id')
      ->join('registration_cities','registration_cities.id','=','vehicles.reg_city_id')
      ->join('colors','colors.id','=','vehicles.color_id')
      ->select('vehicles.*','brands.title as manufacture','engine_types.title as engine_type','transmissions.title as transmission','models.title as model','model_versions.title as model_version','cities.title as city','images.url','model_years.year as year')
      ->orderBy('vehicles.featured',1)
      ->orderBy('vehicles.updated_at','desc');
      
     
    
       return $query->paginate(24);
    }

This Exepetion Shown When next page click URL : www.temp.com/Car/Search?page=2 ERROr:

Whoops, looks like something went wrong.
(1/1) MethodNotAllowedHttpException

NadeemAkhter left a reply on Laravel Paginate Links Not Work

@pardeepkumar @aurawindsurfing thanks for your precious time . I am familiar with Laravel pagination. The issue is in get routes its work perfectly but in post routes it give exception "MethodNotFound" when i click page no 2 or any page . The page where i use pagination is basically a listing page where i show all cars according to user search filters.

26 Sep
1 month ago

NadeemAkhter started a new conversation Laravel Paginate Links Not Work

laravel paginate links in view is not working . In my view a form(POST) submit and then a new view render according to form values in this view links not work they return exception Method not Allowed. i try one solution but this work only for GET form not POST Form

{{ $results->appends(Request::except('page'))->links() }}

anyone know how to fix this issue,thanks.

13 Sep
2 months ago

NadeemAkhter started a new conversation Pusher Payload Limit

is their any way to send message through pusher with payload greater than 10KB because pusher payload limit is 10 KB

28 Jun
4 months ago

NadeemAkhter left a reply on Master Page Attributes

thanks alot @36864 :(

NadeemAkhter started a new conversation Master Page Attributes

I work on e-commerce website ,in my master page layout all categories are shown in header section the issue is i add master page attributes in all routes . is their any way i add these attributes any where else only one time not for all routes.

//////////////////////Header//////////////////////////////////////
       
        $all_categories= Category::where('published',1)->get();
        $nav_categories=Category::with('sub_category','ribbon')->where([['published',1],['shown_nav',1],['parent_id',null]])->get();
      ////////////////////////////////\\ 

these lines of code used in every action

10 Apr
7 months ago

NadeemAkhter started a new conversation Page Reload On Browser Back Button.

I need to somehow detect that the user has pressed a browsers back button and reload the page.because i show cart count on that page if the page is not reload or refresh cart count not updated.

26 Feb
8 months ago

NadeemAkhter left a reply on Add A Object In Shopping Cart

@rumm.an @arthurvillar i used the package here is the link https://github.com/Crinsane/LaravelShoppingcart code also written here.

NadeemAkhter left a reply on Add A Object In Shopping Cart

@rumm.an thanks for you time basically i use package in our laravel project. CartItem and cart both are classes of this package "Gloudemans\Shoppingcart\CartItem"

NadeemAkhter started a new conversation Add A Object In Shopping Cart

I want to add a object of cartitem in the cart.I run the following code but not work.

$cartItem=new CartItem($id,$name,$price,$option);
        Cart::add([$cartItem,1]);

use Gloudemans\Shoppingcart\CartItem;

13 Feb
9 months ago

NadeemAkhter left a reply on Check Current Time Is Between Opening And Closing Time

@tykus in my case only time is used, carbon object create with date also how we can resolve this In my data base time is save in this format: "12:30:00"-"22:30:00" opening time-closing time

NadeemAkhter left a reply on Check Current Time Is Between Opening And Closing Time

@tykus following error shown

InvalidArgumentException
Unexpected data found.
Unexpected data found.
Data missing

in Carbon.php (line 582)

NadeemAkhter left a reply on Check Current Time Is Between Opening And Closing Time

@tykus thanks for your reply. Please guide me little more, this function return "true" or "false " based on current time??

NadeemAkhter started a new conversation Check Current Time Is Between Opening And Closing Time

I have two attributes (opening and closing time) of branch Model, when user click on any branch, system first check the current time is in between opening and closing time then redirect to branch page.

<div class="item-footer">
                                                  <?php $openingTime = \App\Carbon::parse($b->opening_time);
                                                  $closingTime = \App\Carbon::parse($b->closing_time);
                                                  $currentTime=\App\Carbon::now();?>
                                                    
                                                    <div id="branch_time" style="text-align: left"> Branch  closed right now. Timing is {{$b->opening_time}} - {{$b->closing_time}}</div>
                            <a href="{{route('branchFoodMenu',['id'=>$b->id])}}" class="btn view-product">
                                <!--span class="price"><span class="price-no">379</span> Baht</span-->
                                <span class="txt"></i> Select</span>
                            </a>
                        </div>
01 Feb
9 months ago

NadeemAkhter started a new conversation Fetch Record According To Attribute Id

i have three tables Attribute , Attribute-values and item-Attribute-value Attribute : id , title Attribute-values : id ,title, attribute_id Item-attribute-value : id , attribute_value_id , item_id,

one item have multiple attributes so i want to fetch data according to attribute id if item contain only one attribute then return one array with all selected attribute values and if item contain multiple attribute then return multiple array and each array contain their selected values.

 return DB::table('item-attribute-values')
               ->where('item_id',$item_id)
                ->join('attribute_values','attribute_values.id','=','item-attribute-values.value_id')
                ->join('attributes','attributes.id','=','attribute_values.attribute_id')
                ->select('attributes.title as attribute_name','attribute_values.title as attribute_value_name','item-attribute-values.price')
                ->groupBy('attributes.id')
                ->get();

this array return only one value of each attribute

18 Jan
10 months ago

NadeemAkhter started a new conversation Upgrade Laravel Version

I Update the laravel version from 5.2 to 5.4, after updating when i open the login page following error shown.


(1/1) ReflectionException
Class App\Http\Controllers\Auth\LoginController does not exist
04 Jan
10 months ago

NadeemAkhter started a new conversation Order By In Laravel Database

i want to perform multiple orberby function on my database query , below code perform only 1 order by

 return $data=DB::table('vehicles')
      ->where([['cities.id',$id],['images.size','s'],['vehicles.vehicle_type_id',\App\VehicleType::Car],['status','approved'],['vehicles.isDeleted','false']])
       
      ->join('manufactures','manufactures.id' , '=' , 'vehicles.manufacture_id')
      ->join('brands','brands.id','=','manufactures.brand_id')
      ->join('models','models.id' , '=' , 'vehicles.model_id')
     
      ->join('model_versions','model_versions.id','=','vehicles.model_version_id')
      ->join('cities','cities.id' , '=' , 'vehicles.city_id')
      ->join('images','images.post_id' , '=' , 'vehicles.id')
      ->join('model_years','model_years.id','=','vehicles.model_year_id')
      ->join('engine_types','engine_types.id','=','vehicles.engine_type_id')
      ->join('transmissions','transmissions.id','=','vehicles.transmission_id')
      
          

      ->select('vehicles.*','engine_types.title as engine_type','transmissions.title as transmission','brands.title as manufacture','models.title as model','model_versions.title as model_version','cities.title as city','images.url as url','model_years.year as year')
      
     ->latest('vehicles.updated_at')
      ->orderby('vehicles.featured','desc')
               
      ->paginate(20);
      

28 Dec
10 months ago

NadeemAkhter left a reply on Fetch Data On Multiple Tables.

i want this through database because many other joins also apply on this table my query is like this

public function getAllCarsByCity($id)
    {
      return $data=DB::table('vehicles')
      ->where([['cities.id',$id],['images.size','s'],['vehicles.vehicle_type_id',\App\VehicleType::Car],['status','approved'],['vehicles.isDeleted','false']])
       
      ->join('manufactures','manufactures.id' , '=' , 'vehicles.manufacture_id')
      ->join('brands','brands.id','=','manufactures.brand_id')
      ->join('models','models.id' , '=' , 'vehicles.model_id')
     
      ->join('model_versions','model_versions.id','=','vehicles.model_version_id')
      ->join('cities','cities.id' , '=' , 'vehicles.city_id')
      ->join('images','images.post_id' , '=' , 'vehicles.id')
      ->join('model_years','model_years.id','=','vehicles.model_year_id')
      ->join('engine_types','engine_types.id','=','vehicles.engine_type_id')
      ->join('transmissions','transmissions.id','=','vehicles.transmission_id')
      
          

      ->select('vehicles.*','engine_types.title as engine_type','transmissions.title as transmission','brands.title as manufacture','models.title as model','model_versions.title as model_version','cities.title as city','images.url as url','model_years.year as year')
      ->orderby('vehicles.featured','desc')
      ->paginate(35);
      

    }

NadeemAkhter started a new conversation Fetch Data On Multiple Tables.

I have 2 tables one user information and other is images of that user, one user may have more than one images . I want to apply pagination query on data.i apply simple select query but they return one user with one image only dont return the arrray of images

25 Dec
10 months ago

NadeemAkhter started a new conversation Images And Video Compression

I want to compress video and images while uploading in laravel.

21 Dec
10 months ago

NadeemAkhter left a reply on Extends Optional Layout

@SarnaMC its return 2 i will check

NadeemAkhter started a new conversation Extends Optional Layout

i want to extend layout on the base of user if user is other than admin extends clientMaster View.

 @if(Auth::user()->role_id==2) @extends('clientMasterView')

@else  @extends('adminMasterView')

@endif

this code always extends adminMasterView whether role_id 2 or not

18 Dec
11 months ago

NadeemAkhter started a new conversation Upload Image Through Ajax

I want to submit image through ajax request without using FormData class.

var data1={'file':$("#file").val(),}; $.ajax({ url:'/insertCar', type:'POST', dataType: 'json', headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, data:data1, success:function(data){ if($.isEmptyObject(data.error)){ console.log(data); $("#myModal").modal(); }else{ printErrorMsg(data.error);

                }
        }
    });
08 Dec
11 months ago

NadeemAkhter left a reply on Number Verification On Form Submit

Thanks for reply @Snapey basically in my form user write their car information and before submit the form to server, i want number verification process i send a code to user and user enter correct code then form submit successfully.

NadeemAkhter started a new conversation Number Verification On Form Submit

I want to perform verification process on form submit. server side validation are use.

08 Nov
1 year ago

NadeemAkhter started a new conversation Error Shown On Update Query "Object Of Class StdClass Could Not Be Converted To String"

This is the code

public function updateBike($request) { date_default_timezone_set("Asia/Karachi");

    $make = DB::table('manufactures')->where([['brand_id',$request->make],['vehicle_type_id',2]])->first();

    try{
    
  $result=DB::table('vehicles')->where('id',$request->id)->update(['manufacture_id'=>$make,'model_id'=>$request->model,'city_id'=>$request->city,'city_area_id'=>$request->city_area,'price'=>$request->price,'description'=>$request->description,'reg_city_id'=>$request->reg_city,'engine_type_id'=>$request->engine_type,'mileage'=>$request->mileage,'updated_at' => date('Y-m-d H:i:s'),'seller_name'=>$request->name,'number'=>$request->number,'model_year_id'=>$request->year]);
 }catch(\Illuminate\Database\QueryException $ex){ 
    
    dd($ex->getMessage());
}



}
01 Nov
1 year ago

NadeemAkhter started a new conversation Passing Variable(&) In Url

I send data through a get request e.g (my name is nadeem & i am 25 year old) in server side i receive only left part of the & variable that is my name is nadeem . I want to send whole data while using get request .

30 Oct
1 year ago

NadeemAkhter left a reply on Currency Convertor

@RamjithAp This error shown FatalErrorException in CarController.php line 323: Class 'App\Http\Controllers\NumberFormatter' not found

NadeemAkhter started a new conversation Currency Convertor

I want to convert number(price) into word(price). in php e.g 1200 => one thousand and two hundred

25 Oct
1 year ago

NadeemAkhter left a reply on Access Public Folder Of Laravel Project

@jlrdw i want to used images( which are save in another laravel project public folder) in another project

NadeemAkhter started a new conversation Access Public Folder Of Laravel Project

I want to access images from public folder of laravel project in another non-laravel project.

21 Oct
1 year ago

NadeemAkhter started a new conversation Apply Filters On Products Page

I want to apply filters on products page in laravel.In products page list of products are shown. when user click on any filter for example city(Islamabad) then only those products are shown whose location is Islamabad.

11 Oct
1 year ago

NadeemAkhter started a new conversation E-commerce In Laravel

I want to add e-commerce system in our laravel project, please guide me. Thanks in advance..

02 Oct
1 year ago

NadeemAkhter left a reply on PhpStorm

@Jaytee free version give 30 days trial version only. its too expensive.

NadeemAkhter started a new conversation PhpStorm

Anyone have PhpStorm cracker or license key??

NadeemAkhter started a new conversation Integrate Disqus Api With Laravel

I want to integrate disqus api in laravel!.. is this posible??

27 Sep
1 year ago

NadeemAkhter left a reply on Intersection Between Two Query Result

@bandjes Thanks. i think it works perfectly. i don't have much knowledge about Eloquent Query Builder.

NadeemAkhter started a new conversation Fetch Db Result Base Of Different Search Filters

I want search functionality(fetch result from db) base on 8 different filters in laravel 5.2 .Apply only those filters which are selected by user. basically i want dynamic where clause in query.

26 Sep
1 year ago

NadeemAkhter left a reply on Intersection Between Two Query Result

#bandjes

return $data=DB::table('vehicles')
  ->where([[$col.'.id',$id],['vehicles.condition',"used"],['images.size','s'],['status','approved']])
   ->join('vehicle_types','vehicle_types.id','=' , 'vehicles.vehicle_type_id')
  ->join('manufactures','manufactures.id' , '=' , 'vehicles.manufacture_id')
  ->join('brands','brands.id','=','manufactures.brand_id')
  ->join('models','models.id' , '=' , 'vehicles.model_id')
  ->join('vehicle_body_types','vehicle_body_types.id','=','models.bodytype_id')
  ->join('model_versions','model_versions.id','=','vehicles.model_version_id')
  ->join('cities','cities.id' , '=' , 'vehicles.city_id')
  ->join('images','images.post_id' , '=' , 'vehicles.id')
  ->join('transmissions','transmissions.id','=','vehicles.transmission_id')
  ->join('assemblies','assemblies.id','=','vehicles.assembly_id')
  ->join('engine_types','engine_types.id','=','vehicles.engine_type_id')
  ->join('registration_cities','registration_cities.id','=','vehicles.reg_city_id')
  ->select('vehicles.*','vehicle_types.title as vehicle_type','brands.title as manufacture','models.title as model','model_versions.title as model_version','cities.title as city','images.url','transmissions.title as transmission','assemblies.title as assembly','vehicle_body_types.title as body_type','registration_cities.title as reg_city')
  ->orderby('vehicles.featured','desc')
  ->paginate(35);

NadeemAkhter left a reply on Intersection Between Two Query Result

#JackJones we don't know the request parameter is set or not!.. and we have 8 parameters in request object. basically we want the functionality of search filters.

NadeemAkhter left a reply on Intersection Between Two Query Result

this method return the database result

here is the definitionn of mehtod(searchVehiclesByGeneralFilter():

{ return $data=DB::table('vehicles') ->where([[$col.'.id',$id],['vehicles.condition',"used"],['images.size','s'],['status','approved']]) ->join('vehicle_types','vehicle_types.id','=' , 'vehicles.vehicle_type_id') ->join('manufactures','manufactures.id' , '=' , 'vehicles.manufacture_id') ->join('brands','brands.id','=','manufactures.brand_id') ->join('models','models.id' , '=' , 'vehicles.model_id') ->join('vehicle_body_types','vehicle_body_types.id','=','models.bodytype_id') ->join('model_versions','model_versions.id','=','vehicles.model_version_id') ->join('cities','cities.id' , '=' , 'vehicles.city_id') ->select('vehicles.*','vehicle_types.title as vehicle_type','brands.title as manufacture','models.title as model','model_versions.title as model_version','cities.title as city','images.url','transmissions.title as transmission','assemblies.title as assembly','vehicle_body_types.title as body_type','registration_cities.title as reg_city') ->orderby('vehicles.featured','desc') ->paginate(35); }

NadeemAkhter left a reply on Intersection Between Two Query Result

these may be a paginator obejcts like

LengthAwarePaginator {#282 ▼ #total: 4 #lastPage: 1 #items: Collection {#281 ▶} #perPage: 35 #currentPage: 1 #path: "http://localhost:8000/UsedCar/Search" #query: [] #fragment: null #pageName: "page" }

NadeemAkhter started a new conversation Intersection Between Two Query Result

i have two query result if($request->has('city')) { $data1=$this->vehicle->searchVehiclesByGeneralFilter('cities',$request->city); }

 if($request->has('engine_type'))
 {
  $data2=$this->vehicle->searchVehiclesByGeneralFilter('engine_types',$request->engine_type);
 }

i want only common rows in these two arrays $data1 ,$data2