tanveerkhanwd

tanveerkhanwd

Member Since 1 Year Ago

Experience Points
5,200
Total
Experience

4,800 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
22
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.

Level 2
5,200 XP
29 Aug
3 weeks ago

tanveerkhanwd left a reply on How To Store Images ?

problem is when i stored it gives me error that image does not have a default value

tanveerkhanwd left a reply on How To Store Images ?

nothing problem with the storage i just want wright way to store data using

protected  $fillable =[ --all fields--  ];

and  

//This is not correct way to store i just want correct way

$aCart = $request->all();
        if (isset($aCart) && count($aCart)>0) {
            $aCart->images = $aVals;
            $aCart->Cart::create($aCart);

tanveerkhanwd left a reply on How To Store Images ?

hii

here is my controller :

        if($request->hasFile('images')){            
            $images = array();
            foreach ($request->file('images') as $image) {

                $filenamewithextension = $image->getClientOriginalName();
         
                $filename = pathinfo($filenamewithextension, PATHINFO_FILENAME);
         
                $extension = $image->getClientOriginalExtension();
         
                $filenameorignaltostore = $filename.'_'.time().'.'.$extension;
                $filenamethumbtostore = 'thumb_'.$filename.'_'.time().'.'.$extension;

                $images[] = $filenameorignaltostore;
                $image->move(public_path('/uploads/orignal'), $filenameorignaltostore);

                $oldPath = public_path('uploads/orignal/'.$filenameorignaltostore);
                $newPath = public_path('uploads/thumbnail/'.$filenamethumbtostore);
                                    

                if (\File::copy($oldPath , $newPath)) {     
                    $aryNewImage[]=$filenameorignaltostore;
                }

                //Resize image here
                $thumbnailpath = public_path('uploads/thumbnail/'.$filenamethumbtostore);
               
                $img =  Image::make($thumbnailpath)->fit(245, 239, function($constraint){
                            $constraint->upsize();
                        })->save($thumbnailpath);               
                
            }  

            $aVals =json_encode($images);   

        } else{
            $aVals = '';
        }
        /*===== Upload multiple images =======*/
        $aCart = $request->all();
        if (isset($aCart) && count($aCart)>0) {
            $aCart->images = $aVals;
            $aCart->Cart::create($aCart);
            return response()->json(['msg'=>"Item added successfull", 'data'=>$input , 'status'=>true]);
        }else{
            return response()->json(['msg'=>"Something wrong please try again", 'data'=>null , 'status'=>false]);
        }

    }

tanveerkhanwd left a reply on How To Store Images ?

my code:

model:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Cart extends Model
{
    protected $fillable = ['product_id','size_id','user_id','price'];
    /*Product Size Info*/
    public function productSize()
    {
        return $this->belongsTo(ImageSize::class, 'size_id');
    }

    /*Single Product Deatails*/
    public function productDet()
    {
        return $this->belongsTo(Product::class, 'product_id');
    }
}




controller:

public function addCart(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'images.*' => 'required',               
            'product_id' => 'required',               
            'user_id' => 'required',
            'size_id' => 'required',
            'price' => 'required',
        ]);
        $aResponse = array();
        if ($validator->fails()) {
            if ($validator->errors()->first('subject')) {
                $aResponse['msg']=$validator->errors()->first('subject');
                $aResponse['data']=null;
                $aResponse['status']=false;
            }
            if ($validator->errors()->first('description')) {
                $aResponse['msg']=$validator->errors()->first('description');
                $aResponse['data']=null;
                $aResponse['status']=false;
            }
            if ($validator->errors()->first('user_id')) {
                $aResponse['msg']=$validator->errors()->first('user_id');
                $aResponse['data']=null;
                $aResponse['status']=false;
            }
        return response()->json($aResponse);
        }

        /*===== Upload multiple images =======*/
        if($request->hasFile('images')){            
            $images = array();
            foreach ($request->file('images') as $image) {

                $filenamewithextension = $image->getClientOriginalName();
         
                $filename = pathinfo($filenamewithextension, PATHINFO_FILENAME);
         
                $extension = $image->getClientOriginalExtension();
         
                $filenameorignaltostore = $filename.'_'.time().'.'.$extension;
                $filenamethumbtostore = 'thumb_'.$filename.'_'.time().'.'.$extension;

                $images[] = $filenameorignaltostore;
                $image->move(public_path('/uploads/orignal'), $filenameorignaltostore);

                $oldPath = public_path('uploads/orignal/'.$filenameorignaltostore);
                $newPath = public_path('uploads/thumbnail/'.$filenamethumbtostore);
                                    

                if (\File::copy($oldPath , $newPath)) {     
                    $aryNewImage[]=$filenameorignaltostore;
                }

                //Resize image here
                $thumbnailpath = public_path('uploads/thumbnail/'.$filenamethumbtostore);
               
                $img =  Image::make($thumbnailpath)->fit(245, 239, function($constraint){
                            $constraint->upsize();
                        })->save($thumbnailpath);               
                
            }  

            $aVals =json_encode($images);   

        } else{
            $aVals = '';
        }
        /*===== Upload multiple images =======*/
        $input = $request->all();
        if (isset($input) && count($input)>0) {
            $aCart = new Cart;
            $aCart->images = $aVals;
            $aCart->product_id = $request->product_id;
            $aCart->user_id = $request->user_id;
            $aCart->size_id = $request->size_id;
            $aCart->price = $request->price;
            $aCart->save();
            return response()->json(['msg'=>"Item added successfull", 'data'=>$aCart , 'status'=>true]);
        }else{
            return response()->json(['msg'=>"Something wrong please try again", 'data'=>null , 'status'=>false]);
        }

    }





I just want to store data in my database using method protected fillable but 

i don't want to use save method 
$aCart = new Cart;
            $aCart->images = $aVals;
            $aCart->product_id = $request->product_id;
            $aCart->user_id = $request->user_id;
            $aCart->size_id = $request->size_id;
            $aCart->price = $request->price;
            $aCart->save();

tanveerkhanwd left a reply on How To Store Images ?

Yes , multiple images $aVals=["2-standard-binding_1567072524.png","3d-wallpapers-hd-65815-2754760_1567072524.png","Photobooks_1567072524.png"]

tanveerkhanwd started a new conversation How To Store Images ?

controller: where $aVals is in json format

        $input = $request->all();
        $aCart = new Cart;
            $aCart->images = $aVals;
            $aCart->create($input);
            return response()->json(['msg'=>"Item added successfull", 'data'=>$input , 'status'=>true]);
09 Aug
1 month ago

tanveerkhanwd started a new conversation How To Show Selected Item In Select Field

How show this list as selected ietm: Array ( [0] => Broccoli [1] => Carrot [2] => Banana ) view:

$aSelectedVeg = Array ( [0] => Broccoli [1] => Carrot [2] => Banana )
DATA:
@php
    $aSelectedVeg = json_decode($aRowData['title']);
@endphp 
    
Form:
{{Form::select('title',$aRowVegetable,$aSelectedVeg,['id'=>'vegSelect','class'=>'farmer-select2 form-control','required'=>'required','multiple'=>'multiple','onchange'=>'addVegitableDet($(this))'])}}
19 Jul
2 months ago

tanveerkhanwd left a reply on Using A Function From Another Controller

Use this one app('App\Jobs\Game\ActionJob')->activity();

17 Jul
2 months ago

tanveerkhanwd started a new conversation I Facing (1/1) TokenMismatchException In VerifyCsrfToken.php Line 68 And If I Run Following Function {{session_status()}} Without Login So It Gives Me Session_id So If You Understand My Problem Then Help Me ?

when i submit any form it return 'TokenMismatchException in VerifyCsrfToken.php line 68' error ??

and at my local it work fine and on server it return TokenMismatchException error.

14 Jun
3 months ago

tanveerkhanwd left a reply on Can You Please Tell Me How To Get Transcript From Youtube Api?

// i get it but its working on some videos so if any one has another code to retrive so please share

            type: "POST",
            url: "https://video.google.com/timedtext?lang=en&v="+item.id.videoId
            }).done(function (response) {
                console.log(response);
            }).fail(function (response) {
                console.log();
            });

tanveerkhanwd left a reply on Can You Please Tell Me How To Get Transcript From Youtube Api?

through this i am getting only title and video_id and description

tanveerkhanwd started a new conversation Can You Please Tell Me How To Get Transcript From Youtube Api?

//HERE IS MY CODE:

function tplawesome(e,t){res=e;for(var n=0;n<t.length;n++){res=res.replace(/\{\{(.*?)\}\}/g,function(e,r){return t[n][r]})}return res}

$(function(){
    $("form").on("submit", function(e) {
      e.preventDefault();
      // prepare the request
      var request = gapi.client.youtube.search.list({
            part: "snippet",
            type: "video",
            videoEmbeddable: true,
            videoCaption:"any",
            q: encodeURIComponent($("#search").val()).replace(/%20/g, "+"),
            maxResults: 1,
            order: "viewCount",
            publishedAfter: "2015-01-01T00:00:00Z"
      });
      //execute the request
      request.execute(function(response) {
          var results = response.result;
          console.log(results);
          var html = '';
          $.each(results.items, function(index, item){
            html += '<div class="youtubeid col-sm-3 col-md-3 col-lg-3"><div class="card"><div class="embed-responsive embed-responsive-16by9">';
            html += '<iframe custAttr="'+item.id.videoId+'" custtitle="'+item.snippet.title+'" class="embed-responsive-item" src="//www.youtube.com/embed/'+item.id.videoId+'" allowfullscreen></iframe>';
            html += '</div><div class="card-body ytcard-text">'+item.snippet.title+'</div></div></div>';  
            $("#results").css("display","block").html(html);
          });
          
          var singleVhtml = '';
          $(".youtubeid").click(function(){
            $(".hidesearchcontainer").css("display","none");
            var videoId = $(this).find("iframe").attr("custAttr");
            var videoTitle = $(this).find("iframe").attr("custtitle");
            
            singleVhtml+= '<div class="col-sm-8 col-md-8 col-lg-8 col-xl-8" ><div class="embed-responsive embed-responsive-16by9"><iframe class="embed-responsive-item" src="//www.youtube.com/embed/'+videoId+'" allowfullscreen></iframe></div>';
            singleVhtml+= '<div class="row"><div class="ytcard-text title col-sm-8 col-md-8 col-lg-8 col-xl-8">'+videoTitle+'</div><div class="icon col-sm-4 col-md-4 col-lg-4 col-xl-4">';
            singleVhtml+= '<i class="fa fa-thumbs-o-up"></i>12k<i class="fa fa-thumbs-o-down"></i>1k<i class="fa fa-share"></i>SHARE<i class="fa fa-list"></i>SAVE<i class="fa fa-ellipsis-h"></i></div></div></div>';
            $("#showvideodata").css("display","block").html(singleVhtml);
          });
          resetVideoHeight();
       });
    });
    
    $(window).on("resize", resetVideoHeight);
});

function resetVideoHeight() {
    $(".video").css("height", $(".results").width() * 9/16);
}

function init() { 
    //AIzaSyA7WkJ27_jWV03d_fb0w9mfa2lxfGIAtqU  AIzaSyB1l24kUu6gaBEjItEyvliG8sw6D2TEbVw
    gapi.client.setApiKey("AIzaSyA7WkJ27_jWV03d_fb0w9mfa2lxfGIAtqU");
    gapi.client.load("youtube", "v3", function() {
        // yt api is ready
    });
}
09 Jun
3 months ago

tanveerkhanwd left a reply on Help Me To Display Image

hii sir i try it but not working

tanveerkhanwd started a new conversation Help Me To Display Image

//view page :
  <td><img src="{{asset('hotel/storage/app/'.$getData->image)}}"></td>

// Controller :
if($request->hasFile('image')){
            $image_path = $request->file('image')->store('public/hotel');
            $hotel->image = $image_path;
        }
//
30 May
3 months ago

tanveerkhanwd left a reply on I Just Want To Try Calculate Percentage

i want all game field with percentage field

tanveerkhanwd started a new conversation I Just Want To Try Calculate Percentage

//THE FOLLOWING CODE IS NOT WORKING 
$startWeight = $gw->start_weight;
$endWeight = $gw->weight;
$act = GameActivityWet::where('game_id','=',$gw->game->id)->where('type','=',2)->where('status','=',1)->groupBy('creator_id')->select('*','weight($startWeight/$endWeight*100) as percentage')->get();
30 Apr
4 months ago

tanveerkhanwd started a new conversation I Just Want To Redirect To The Route With Param From Controller Can You Please Help Me ?

//here is my UserController.php
public function Logininme(Request $request)
    {
        //$game_id = Game::where('user_id','=',$request->id)->orderBy('id','DESC')->first();
        $validator =Validator::make($request->all(), [
            'email' => 'required|email',
            'password' => 'required'
        ]);
        if ($validator->fails()) {
            return Response()->json(array('success' => false, 'errors' => $validator->messages()));
        }
        if (Auth::attempt(['email' => $request->email, 'password' => $request->password, 'status_ban'=>0]))
        {
            Session::put('profimg', Auth::user()->uprofiles->pimg);
                 return Response()->json(array('success' => 'success', 'errors' => 'fffff','route' => 'profile'));
        }
        else
        {
            return Response()->json(array('success' => 'loginfail', 'errors' => 'Email or Password is incorrect or your account banned by admin. '));
        }
        

    }

//Here is my angular code to redirect to the page :
$scope.loginme = function() {
        console.log($scope.login);
        httpService.signinme($scope.login).then(function (data) {
            $scope.loginretval = data.data;
            if(data.data.route=='profile')
          {
             window.location= 'profile';
          }
      });
    }
24 Apr
4 months ago

tanveerkhanwd left a reply on How To Run This Raw Query In Laravel

Thank You so much its very helpful

tanveerkhanwd started a new conversation How To Run This Raw Query In Laravel

//I am just trying to use this query in my controller:

SELECT *,(select gaw.weight FROM game_activity_wets gaw WHERE gaw.creator_id=game_activity_wets.creator_id AND gaw.type=0 AND gaw.game_id=game_activity_wets.game_id) as startweight FROM `game_activity_wets` WHERE game_id=37 and type=2 GROUP BY creator_id
10 Apr
5 months ago

tanveerkhanwd started a new conversation How To Validate Select ?

//View File:
<select name="gameType">
<option>SELECT GAME TYPE</option>
@forelse($gameType as $results)
    <option value="{{$results->id}}">{{old('gameType')}}{{ $results->name }}</option>
@empty
    <option> No Data Found </option
@endforelse
</select>

// Controller file 
$this->validate($request,[
            'gameType' => 'required',
]);
09 Apr
5 months ago

tanveerkhanwd started a new conversation How To Use OrderBy? OrderBy Not Work?

$auth = Auth::user()->id;
        $activity = GameActivity::join('game_joins', function ($join) use($auth,$game){
                $join->on('game_activities.game_join_id', '=', 'game_joins.id')
                 ->where('game_joins.user_id','=',$auth)->where('game_joins.game_id','=',$game->id)->orderBy('game_activities.id','DESC');
        })->first();
02 Apr
5 months ago

tanveerkhanwd started a new conversation How To Use Group By On 'game_type_id' ?

public function index()
    {
  
        $game = Game::orderBy('id','DESC')->where('status','=',1)->where('end_date','>=',$now)->where('is_approved','=',2)->where('game_type_id','!=',5)->groupBy('game_type_id')->limit(4)->get();
        return view('healthduel.pages.home',compact('game'));
    }
26 Mar
5 months ago

tanveerkhanwd left a reply on Auth::user() Returning NULL

dd(Auth::user());

tanveerkhanwd started a new conversation Store Multiple Email With Comma Separated And Also Set Unique

//my controller:
//send them to gmail
public function inviteEmailId(Request $request)
    {
        $string =$request->email[0];
        $str_arr = explode (",",$string);
        $gameid = $request->game_id;

        foreach ($str_arr as $email_id) {
        $inviteData  = Invite::select('email','game_id')->where('game_id','=',$gameid)->whereIn('email',$str_arr)->get();
        if (count($inviteData)>=1) {
            return redirect()->back()->with('errors','Email Already Exist');
        }
        $invite = new Invite;
        $invite->game_id = $request->game_id;
        $invite->email = $email_id;

        Mail::send(['html'=>'healthduel/pages/multipl_email_id'],['name'=>'healthduel'],function($message) use($email_id){
                $message->to($email_id)->subject('Invitation');
                $message->from('[email protected]','healthduel');

            });
            $invite->save();
        }
        return redirect()->route('game.listing')->with('success','Invitation successfully Sent'); 
    }
07 Mar
6 months ago

tanveerkhanwd started a new conversation Find Out Days Between Two Dates

// here is the answer:
<?php
        $now  = \Carbon\Carbon::now();
       $end  = $results->start_date;
     print $now->diffInDays($end);
?>

tanveerkhanwd started a new conversation How I Get Only Day-mouth From Date

// iam trying to get date in this format: dd-mm only and how i display on screen like this :  07-march
<p>
    <i class="far fa-calendar-alt"></i> 
        {{ $results->start_date}} - {{ $results->end_date }}
    </p>
05 Mar
6 months ago

tanveerkhanwd left a reply on How To Add 4 Weeks In Start_date And Store In End_date In Database

Its also working:
public function store(Request $request)
    {
        $this->validate($request,[
            'image' => 'required',
            'name' => 'required|unique:games',
            'type' => 'required',

        ]);
        $day =  new Carbon($request->start_date);
        $day = $day->addWeek(4);
        $end_date = $day->toDateString();
        
        if($request->hasFile('image')){
            $image_path = $request->file('image')->store('game');
        } 
        $game = new Game;
        $game->image = $image_path;
        $game->name = $request->name;
        $game->user_id = Auth::user()->id;
        $game->start_date = $request->start_date;
        $game->end_date =$end_date;
        $game->description = $request->description;
        $game->bet_amount = $request->bet_amount;
        $game->type = $request->type;
        $game->save();

        return redirect()->route('game.listing')->with('success','Game store successfully');
    }

tanveerkhanwd started a new conversation How To Add 4 Weeks In Start_date And Store In End_date In Database

public function store(Request $request)
    {
        $numDays = 28;
        $days = $request->start_date;
        $days = addDays($numDays);
        $this->validate($request,[
            'image' => 'required',
            'name' => 'required|unique:games',
            'type' => 'required',

        ]);

        if($request->hasFile('image')){
            $image_path = $request->file('image')->store('game');
        } 
        $game = new Game;
        $game->image = $image_path;
        $game->name = $request->name;
        $game->user_id = Auth::user()->id;
        $game->start_date = $request->start_date;
        $game->end_date = $days;
        $game->description = $request->description;
        $game->bet_amount = $request->bet_amount;
        $game->type = $request->type;
        $game->save();

        return redirect()->route('game.listing')->with('success','Game store successfully');
    }
04 Mar
6 months ago

tanveerkhanwd started a new conversation How I Delete My Image Path When I Delete My Whole Field From Database

public function destroy($id)
    {
        $game = Game::find($id);
        $game->delete();
        return redirect()->route('game.listing')
                        ->with('success','Game delete successfully');
    }
26 Feb
6 months ago

tanveerkhanwd left a reply on How To Pass Argument To Middleware " I Pass Parameter 'admissions' In $type"

@MANELGAVALDA - i want to pass a parameter in my controller and using that parameter in my middleware

tanveerkhanwd started a new conversation How To Pass Argument To Middleware " I Pass Parameter 'admissions' In $type"

//My Middleware :
public function handle($request, Closure $next, $type)
    {
        if (Auth::User()->role_id!=1) {
            $currentUser = Auth::user()->role_id;
            $permissionData = Privilege::select('role_id','permission')
            ->where('role_id','=',$currentUser)->first();
            $permissionData = json_decode($permissionData['permission'],true);
            if ($permissionData->$type) {
                return $next($request);   
               }
            else
            {
                return redirect()->back();   
            }   
        }
        else
        {
            return $next($request);
        }
    }


// My Controller:

public function __construct()
    {
        $this->middleware('permission:admissions');
    }
25 Feb
6 months ago

tanveerkhanwd started a new conversation How To Retrive Single Key Value From Array Stored In Database

//1. I have this array that stored in my Privilege table  in permission column:
//  2.i want to access only [admission] key  data  
// 3. Which query  help me. 
stdClass Object
(
    [admission] => stdClass Object
        (
            [listing] => on
            [delete] => on
            [print] => on
            [pdf] => on
        )

    [image] => stdClass Object
        (
            [listing] => on
            [print] => on
            [pdf] => on
        )

    [events] => stdClass Object
        (
            [listing] => on
            [delete] => on
            [add] => on
            [print] => on
            [pdf] => on
        )

// This Is my finction that have argument $type in $type i passed 'admission' 

public static function subPermision($type="")
    {
        $currentUser = Auth::user()->role_id;
        $aPrivilegeData = Privilege::where('role_id','=',$currentUser)->orwhere('permission','->',$type)->first();
        return $ajsonData = json_decode($aPrivilegeData['permission']);
    }
20 Feb
7 months ago

tanveerkhanwd started a new conversation How To Check Or Uncheck All Checkbox From One Button

// Here is my Js:

<script>
    // v1
function checkAll1() {

  var inputs = document.querySelectorAll('.check1');
  for (var i = 0; i < inputs.length; i++) {
    inputs[i].checked = true;
  }

  this.onclick = uncheckAll1;
}

function uncheckAll1() {
  var inputs = document.querySelectorAll('.check1');
  for (var i = 0; i < inputs.length; i++) {
    inputs[i].checked = false;
  }

  this.onclick = checkAll1; //function reference to original function
}
  </script>


Here Is My View Html page :
<form>
        <legend>Version 1<small>Single buttons</small></legend>
        <div class="checkbox">
          <input type="button" id="checkall1" onclick="checkAll1()" class="btn btn-link" value="Un/check All">
        </div>
        <div class="checkbox">
          <label>
            <input type="checkbox" class="check1"> Check me out
          </label>
        </div>
        <div class="checkbox">
          <label>
            <input type="checkbox" class="check1"> Check me out
          </label>
        </div>
        <div class="checkbox">
          <label>
            <input type="checkbox" class="check1"> Check me out
          </label>
        </div>
      </form>

tanveerkhanwd started a new conversation How I Set Checked Or Uncheked Using Jquery

      {{ csrf_field() }}
      <table id="" class="table table-bordered table-striped">
        <thead>
          <tr>
            <th style="width: 15%" class="center">#</th>
            <th style="width: 15%" class="center" colspan="6">permissions</th>
          </tr>
          <tr>
            <th style="width: 15%" class="center"></th>
            @foreach($allowPermission as $result)
            <th style="width: 15%" class="center">{{$result}}<br> 
              <input type="checkbox" name="" id="{{$result}}">
            </th>
            @endforeach
          </tr>
        </thead>
        <tbody>
         
          @foreach($aRolePermission as $results)
          <tr>
            <th>
              {{$results}}
              <input type="checkbox" name="" class="right" id="{{$results}}" >
            </th>
              @foreach($allowPermission as $result)
            <td class="center">
              <input type="checkbox" name="permission[{{$results}}][{{$result}}]" class="{{$results}} {{$result}}" checked="checked">
            </td>
            @endforeach
          </tr>
          @endforeach  
                  
        </tbody>             
      </table>
      <div class="box-footer">
        {!! Form::submit('Update',['class'=>'btn btn-primary']); !!}
      </div><!-- /.box-footer -->
      {!! Form::close() !!}

tanveerkhanwd started a new conversation How To Use Json Encode On Following Data

(
    [_method] => PATCH
    [_token] => pp7bjIqWRL8hatrNyh4ZPtNeb8i6lpjD51QCzFMw
    [permission] => Array
        (
            [Admission] => Array
                (
                    [listing] => on
                    [Edit] => on
                    [Delete] => on
                    [Add] => on
                    [Print] => on
                    [Pdf] => on
                )

            [Announcement] => Array
                (
                    [listing] => on
                    [Edit] => on
                    [Delete] => on
                    [Add] => on
                    [Print] => on
                    [Pdf] => on
                )

            [Blogs] => Array
                (
                    [listing] => on
                    [Edit] => on
                    [Delete] => on
                    [Add] => on
                    [Print] => on
                    [Pdf] => on
                )
19 Feb
7 months ago

tanveerkhanwd started a new conversation How Can I Print Array Data Into My View Table

<?php print_r($aRolePermission);die(); ?>

// In $aRolePermission i got this array:

Array ( [0] => Admission [2] => Announcement [3] => Blogs [4] => Category [5] => ContactUs [6] => Enquiry [7] => Events [8] => Faq [9] => JobPosition [10] => JobVacancy [11] => ManageRole [12] => Media [13] => Menu [14] => News [15] => NewsLetter [16] => Pages [17] => Profile [18] => ProgramWeOffer [19] => RolePermission [20] => Slider [21] => StaticPage [22] => Testimonials [23] => University ) 
//
how can i print all data into table
15 Feb
7 months ago

tanveerkhanwd left a reply on How To Search Data From Database Using Array

Right Answer is Here:
public function index(Request $request)
    {
        $search = \Request::get('search');
        $records = config('constant.displayPageRecords');
        
        $query = Admission::whereNotNull('name');
        $aCon=array();
        if (!empty($search)) {
            $query = $query->where(function ($qry) use($search){
                return $qry->where('name','like','%'.$search.'%')
                   ->orwhere('city','like','%'.$search.'%')
                   ->orwhere('dob','like','%'.$search.'%')
                   ->orwhere('present_school','like','%'.$search.'%');
                });
        }
        
        $admission = $query->paginate($records)->appends($request->except('page'));
        return view('admin.admission.index',['admission'=>$admission,'records'=>$records]);
    }
14 Feb
7 months ago

tanveerkhanwd left a reply on How To Search Data From Database Using Array

help me to get out from this problem please

tanveerkhanwd started a new conversation How To Search Data From Database Using Array

My controller Page:

public function index(Request $request)
    {
        $search = \Request::get('search');
        $records = config('constant.displayPageRecords');
        
        
        
        $aCon=array();
        if (!empty($search)) {
            $aCon = array
             (
                array('name','like',$search),
                array('city','like',$search),
                array('type','like',$search)
                
             );
        }
        
        $admission = Admission::where($aCon)->paginate($records);
        print_r($aCon);
        return view('admin.admission.index',['admission'=>$admission,'records'=>$records]);
    }

tanveerkhanwd left a reply on How I Search Data From Multiple Colunm In Database Using Array

@SAURABHD - i want all the data into array format sir

tanveerkhanwd started a new conversation How I Search Data From Multiple Colunm In Database Using Array

my controler:

        
        $aCon= array();
        if (!empty($request->input('search'))) {
            $aCon['name'] = $search;
            $aCon['city'] = $search;
            $aCon['present_school'] = $search;
        }
        $records = config('constant.displayPageRecords');
        $admission = Admission::where($aCon,'like','%'.$search.'%')->paginate($records);
        return view('admin.admission.index',['admission'=>$admission,'records'=>$records]);

tanveerkhanwd left a reply on How To Search Data From More Then One Field In Laravel

how to search data from more then one field in laravel

tanveerkhanwd started a new conversation How To Search Data From More Then One Field In Laravel

my view:

        <div class="box-body">
          {{ csrf_field() }}
          <!-- text input -->
          <div class="form-group">
            <div class="col-sm-3">
              {!! Form::text('search','',['class'=>'form-control','placeholder'=>'Search','required'=>'required']); !!}
              <span class="text-danger">{{ $errors->first('search') }}</span>
            </div>
            <div class="col-sm-2">
              {!! Form::submit('search',['class'=>'btn btn-primary']); !!}
              <span class="text-danger">{{ $errors->first('status') }}</span>
            </div>
          </div>
      {!! Form::close() !!} 

My Controller:

public function index(Request $request)
    {
        $search = \Request::get('search');
        
        $records = config('constant.displayPageRecords');
        $admission = Admission::where('name','like','%'.$search.'%')
        ->orderBy('name')->paginate($records);
        return view('admin.admission.index',['admission'=>$admission,'records'=>$records]);
    }