bipin

Experience

1,980

0 Best Reply Awards

  • Member Since 1 Month Ago
  • 0 Lessons Completed
  • 0 Favorites

29th April, 2017

bipin left a reply on How I Can Submit This Dynamically Jquery • 1 day ago

Thanks @saurabhd

bipin left a reply on How To Pass Value From Js To Controller • 1 day ago

@gustav I want to create my own not need any package

bipin left a reply on How To Pass Value From Js To Controller • 1 day ago

@topvillas it's method of JavaScript to convert value of id

23rd April, 2017

bipin started a new conversation Concat Input Type In Javascript • 1 week ago

here guys i m new to laravel so please help me for this type of silly question i want to concat id="name{{$s->id}}" here name is hardcode and $s->id is getting from database i want to concat this thing and how i can pass input[i++] to my controller in laravel i m using laravel thanks in advance

   $("#form1").append('<div class="row"><label>{{$s->fieldname}}</label><input 
   type="text" name="name" id="{{$s->id}}"></div>');
   input[i++] = document.getElementById("{{$s->id}}").value;
   here is my contoller how i can recieve array of data (input[i++]) over here

       public function insert1(Request $request)
   {
   
    $name = $request->input(input[i]);
 //dd($name);

bipin left a reply on Forloop Is Not Working • 1 week ago

@zachleigh i m getting some value from db and according to that my input type="text " is create suppose if i save fieldname=model and field type =text then value check at my view wheather field type belong to text or area according to that my input appear in my vew page

bipin left a reply on Forloop Is Not Working • 1 week ago

I want to create dynamic input type and store it to db

bipin left a reply on Forloop Is Not Working • 1 week ago

Then how I can achieve need help

bipin started a new conversation Forloop Is Not Working • 1 week ago

in this code i m generating input type dynamically after that i can store it to database in different column the problem here i m facing that id should be unque for that i use forloop its working mean incrementing my value but does not know how to apply to id="name" moreover it does not appending input type="text" to form1 line (no 7)

  1. problem is that since my input type is dynamically so how i can request it to my controller here is my view

             $(document).ready(function() {
                         debugger
                         var c=[];
                          
    
                    @foreach($result as $s)
                    @if($s->fieldtype=='text')
                    for(var i=0;i++;){
                     $("#form1").append('<div class="row"><label>{{$s->fieldname}}
   </label><input type="text" id="name"><input type="hidden" id="detailtbl[x+1]" value="{{$s-
    >id}}"> </div>');
                    
            }
                     @elseif($s->fieldtype=='textarea')
                     $("#form1").append('<div class="row">{{$s->fieldname}}<input 
     type="text" id="nametext"><input type="text" value="{{$s->id}}" id="nameid1"> </div>');
                     
                     @endif
                      @endforeach
              
                  

});

22nd April, 2017

bipin left a reply on How I Can Submit This Dynamically Jquery • 1 week ago

if found my soultion

bipin started a new conversation How I Can Submit This Dynamically Jquery • 1 week ago

here is my view where i have jquery i want that all dynamically add input should be submit to controller and i do not know how i can achieve that these input type is dynamically i m tryig to achieve it in laravel so for my english

    <script type="text/javascript">
                    $(document).ready(function() {
                    @foreach($result as $s)
                    @if($s->fieldtype=='text')
                     $("#form1").append('<div class="row"><label>{{$s-
                                 >fieldname}}</label><input type="text" name="" id> </div>');
                     @elseif($s->fieldtype=='textarea')
                     $("#form1").append('<div class="row">{{$s->fieldname}}<input 
                           type="text" name=""><input type="text"  </div>');
                     @endif
                      @endforeach
                      $("#form1").append('<div> <input type="submit" 

   value="Submit" href="{{url('select2')}}"></div>');

           });  
                    </script>

href is not working

bipin left a reply on Undefine Variable Result • 1 week ago

@foreach($result as $s) at line 8 its throwing error undefine variable result

bipin started a new conversation Undefine Variable Result • 1 week ago

i m trying to fetch result in foreach loop but its throwing error here is my view

    <div id="container">
            <h2>D</h2>
                                            <div id="form1">
                                            
                                            </div>
            </div>       
                    <script type="text/javascript">
                    $(document).ready(function() {
                    @foreach($result as $s)
                    @if($s->fieldtype==text)
                     $("#form1").append('<div class="row"><label>{{$s->fieldname}}
            </label><input type="text" name=""> </div>');
                     @elseif($s->fieldtype==textarea)
                     $("#form1").append('<div class="row">{{$s->fieldname}}<input 
          type="text" name=""> </div>');
                     @endif
                      @endforeach

                   $("#form1").append('<div><button class="primary" type="submit">save</button>
         </div>'); 
               });
                    </script>

i also check using dd($result) in controller its getting value

20th April, 2017

bipin left a reply on Invalid Argument Supplied For Foreach() • 1 week ago

thanks @Snapey i don't know how to thank you........... thankss alot its clear my concept about relationship

bipin started a new conversation Invalid Argument Supplied For Foreach() • 1 week ago

@Snapey Category.php Model

  public function products()
  {
   return $this->hasMany(Product::class);
   }

public function subCategories()
{
return $this->hasMany(SubCategory::class,'id_category');
 }

SubCategories.php Model public function products() { return $this->hasMany(Product::class,'id_subcategory'); } public function category() { return $this->belongsTo(Category::class); } Product.php Model

 public function category()
 {
return $this->belongsTo(Category::class);
 }

in controller:

    $categories = Category::with('subcategories.products')->get();

in view:

   <ul>
         @foreach($categories as $category)
                echo'<li value=""> {{$category->namecategory}}';
              
                  <ul>
                  @foreach($category->subCategories as $subCategory)
                     echo'<li value="">{{$subCategory->namesubcategory}}';

                                <ul>
                         @foreach($subCategory->products as $product)
                              echo'<li value="">{{$product->namesubling}}</li>';
                                 @endforeach
                               </ul>
                              </li>
                  @endforeach
                        </ul>

                     </li>
          @endforeach
             </ul>

its throwing error Invalid argument supplied for foreach() if i remove 2 foreach then its working i know that its not taking data as array so its throwing error but how i can do so i can achieve my desire view

       mobile and accessory
                mobile
                     iphone
                mobile cover
                    iphone cover 

i m try to achieve like this don't know how i do that please help me guys

bipin left a reply on Syntax Error, Unexpected '<' In View • 1 week ago

@Snapey view

       <ul>
   
         @foreach($result as $m)
                <li value=""> {{$m->namecategory}}
              
                  <ul>
                   @foreach($m->idsubcategory as $m)
                       <li value="">{{$m->namesubcategory}}

                                <ul>
                       @foreach($m->idsubling as $m)
                              <li value="">{{$m->namesubling}}</li>
                                 @endforeach
                               </ul>


                              </li>
                  @endforeach
                        </ul>

                     </li>
          @endforeach
             </ul>

and controller

    $result = Category1::all();

    return view('myform',compact('result')); 

if i use nested foreach its throwing error Invalid argument supplied for foreach() (View: and if i use single foreach then its give me result like this

   mobile and accessory
         mobile
             iphone
    mobile and accessory
         mobile cover
                iphone cover

but i want like this

 mobile and accessory
     mobile
          iphone
     mobile cover
          iphone cover 

bipin left a reply on Syntax Error, Unexpected '<' In View • 1 week ago

@Snapey actually i had created a model previsouly but i m not getting desire result if you help me it would be great here is my model view product1

  class product1 extends Model
{
protected $table='subling';

protected $fillable=['idsubling','namesubling','idsubcategory_subcategory'];
    public function subCategories()
 {
   return $this-

belongsTo(Subcategory1::class,'idcategory_mastercategory','idsubcategory'); } } class Subcategory1 extends Model { protected $table = 'subcategory'; protected $fillable= ['idsubcategory','idsubcategory_subcategory','namesubcategory'];

model subcategory

 public function category()
 {
return $this-

belongsTo(Category1::class,'idsubcategory_subcategory','idsubcategory'); }

 public function products()
{
 return $this-

hasMany(Product1::class,'idsubcategory_subcategory','idsubling'); } } model category class Category1 extends Model { protected $table = 'mastercategory'; protected $fillable=['idcategory','namecategory'];

public function subCategories()
  {
return $this->hasMany(Subcategory1::class,'idcategory_mastercategory','idsubcategory');
}

} it giving me result like this

  mobile and accessory
         mobile
              iphone
   mobile and accessory
         mobile cover
              iphone cover

but i want like this

 mobile and accessory
         mobile
              iphone
         mobile cover
              iphone cover

  

bipin left a reply on Syntax Error, Unexpected '<' In View • 1 week ago

@Cronin after everyone reply i thought i should do this logic in controller so i had written this logic can anyone rectify its please its also throwing error here is my controller

    $a=[];
  $b=[];
  $c=[];
 foreach ($users as $u) {
      if ($a!==namecategory) {

          $a=$u->namecategory
        }
             if ($b!==namesubcategory) {
                 $b=$u->namesubcategory
                 }
                    if ($c!==namesubling) {
                        $c=$u->namesubling
                      }  
         
   }


    return view('myform',compact('a','b','c'));

bipin left a reply on Syntax Error, Unexpected '<' In View • 1 week ago

@willvincent is there other way to achieve this??

bipin left a reply on Syntax Error, Unexpected '<' In View • 1 week ago

but this time i need logic in my view i will we appreciateif you help me

bipin started a new conversation Syntax Error, Unexpected '<' In View • 1 week ago

hello guys i m using laravel 5.4 and i m trying php in view but its throwing error unexpected '<' here is my view

      <ul>
       
     <?php

      $a = '';
       $b = '';
        $c = '';

         foreach($result as $m){
                    if($a!==$m->namecategory){
                    <li value=""> {{$m->namecategory}}
              
              $a[]=namecategory;
              }
                       <ul> 
                   
                               
                         if($b!==namesubcategory){
                              <li value="">{{$m->namesubcategory}}</li>

                                 $b=namesubcategory;
                                 }
                                 <ul>

                              if($c!==namesubling){
                                  <li value="">{{$m->namesubling}}</li>
                                  $c=namesubling;
                                  }
                                 </ul>


                              </li>
                 }
                   ?>
                        </ul>

in this code i m try to intially initiate $a,$b,$c after comparing i m try to store value in a,b,c is there other way to achieve these thing in laravel

bipin started a new conversation How To Create Dynamic <li> In Jstree • 1 week ago

here is controller

          $result  =   DB::select(" select a.*,d.*  from mastercategory a
                  RIGHT join  
               (select b.*,c.* from subcategory b inner join subling c  on  
                b.idsubcategory=c.idsubcategory_subcategory) as d on 
        a.idcategory=d.idcategory_mastercategory");

here is my view

           <ul>
           @foreach($result as $m)
                    <li> {{$m->namecategory}}
                       <ul> 
                              <li>{{$m->namesubcategory}}                                    
                                 <ul>
                                  <li>{{$m->namesubling}}</li>                                      
                                 </ul>
                              </li>                          
                       </ul>
                   </li>        
         @endforeach  
             </ul>
        </li>
  </ul>

    <script>

  $(function () {   
   $('#tree').jstree();
  $('#tree').on("changed.jstree", function (e, data) {
  console.log(data.selected);
});
});
 </script>

in the above code i get the view like this Mobile & Accessories Mobile Iphone Redmi Mobile & Accessories Mobile Cover Iphone cover Redmi cover

but i want view like this

Mobile & Accessories
    Mobile
        Iphone
        Redmi
    Mobile Cover
        Iphone cover
        Redmi cover

    

my problem is that how i want to create

  • dynamically suppose
  • {{$m->namesubcategory}} has more than one data name entry then it should repeat there only until sub category fetch all data then it move next
  • bipin left a reply on Throwing Error Undefine Namecategory • 1 week ago

    @tisuchi thanks for your reply its throwing error Undefined variable: namesubcategory in my controller

    bipin started a new conversation Throwing Error Undefine Namecategory • 1 week ago

    here is my dd output

      array:3 [▼
       0 => {#209 ▼
     +"idcategory": 1
      +"namecategory": "mobile and assces"
      +"created_at": null
      +"updated_at": null
      +"idsubcategory": 1
      +"namesubcategory": "mobile"
      +"idcategory_mastercategory": 1
      +"idsubling": 1
      +"namesubling": "iphone"
      +"idsubcategory_subcategory": 1
       }
      1 => {#211 ▼
     +"idcategory": 1
     +"namecategory": "mobile and assces"
     +"created_at": null
     +"updated_at": null
     +"idsubcategory": 2
     +"namesubcategory": "mobile cover"
     +"idcategory_mastercategory": 1
     +"idsubling": 2
     +"namesubling": "nexu cover"
     +"idsubcategory_subcategory": 2
     }
     2 => {#212 ▼
     +"idcategory": 2
     +"namecategory": "elect"
     +"created_at": null
     +"updated_at": null
     +"idsubcategory": 3
     +"namesubcategory": "lap"
     +"idcategory_mastercategory": 2
     +"idsubling": 3
     +"namesubling": "hp"
       +"idsubcategory_subcategory": 3
      }
    ]
    

    here in my controller i m trying to store every value for eg idcategory,name etc to store in here

         $result = [];
      foreach ($users as $u) {
      $result[ $u-> namecategory ] = $result[ $u-> namecategory ] ?? [];
    
       $result[ $u-> namecategory][$namesubcategory] = $result[ $u-> namecategory ]
       [$namesubcategory] ?? [];
    
     $result[ $u-> namecategory ][$namesubcategory][] = $u-> namesubling;
    }
    

    19th April, 2017

    bipin left a reply on Nested Looping Not Working • 1 week ago

    -mobile and accessory (mastercategory) 1.mobile(subcategory) 1.iphone(subling) 1.mobile cover(subcategory) 1.iphone cover(subling)

    try to accomplish like this structure

    bipin left a reply on Nested Looping Not Working • 1 week ago

    any other solution ?

    bipin left a reply on Nested Looping Not Working • 1 week ago

    here is dd result

    array:3 [▼
    

    0 => {#209 ▼ +"idcategory": 1 +"namecategory": "mobile and assces" +"created_at": null +"updated_at": null +"idsubcategory": 1 +"namesubcategory": "mobile" +"idcategory_mastercategory": 1 +"idsubling": 1 +"namesubling": "iphone" +"idsubcategory_subcategory": 1 } 1 => {#211 ▼ +"idcategory": 1 +"namecategory": "mobile and assces" +"created_at": null +"updated_at": null +"idsubcategory": 2 +"namesubcategory": "mobile cover" +"idcategory_mastercategory": 1 +"idsubling": 2 +"namesubling": "nexu cover" +"idsubcategory_subcategory": 2 } 2 => {#212 ▼ +"idcategory": 2 +"namecategory": "elect" +"created_at": null +"updated_at": null +"idsubcategory": 3 +"namesubcategory": "lap" +"idcategory_mastercategory": 2 +"idsubling": 3 +"namesubling": "hp" +"idsubcategory_subcategory": 3 } ]

    bipin started a new conversation Nested Looping Not Working • 1 week ago

    here is my view and i don't know why my nested looop not working please help me

              <ul>
             @foreach($users as $m)
                        <li> {{$m->namecategory}}
    
                           <ul> 
                           @foreach($m->sub as $nam)
                                  <li>{{$nam->namesubcategory}}
                                  
                                     <ul>
                                       @foreach($nam->subling as $lan)
                                            <li>{{$lan->namesubling}}</li>
    
                                      @endforeach
                                     </ul>
    
    
                                  </li>
                              @endforeach
                           </ul>
    
                       </li>
                
             @endforeach  
                 </ul>
    

    its throwing error like this

     Undefined property: stdClass::$sub (View: 
    

    bipin left a reply on Query And Subquery Join In Alravel • 1 week ago

    here is my update

       $users  =   DB::raw(" select a.*,b.*  from mastercategory a
                      inner join  
                   (select b.*,c.* from subcategory b inner join subling c  on  
               b.idsubcategory=c.idsubcategory_subcategory) on 
              a.idcategory=b.idsubcategory_subcategory"); 
    

    why i m getting empty value

    bipin started a new conversation Query And Subquery Join In Alravel • 1 week ago

    i m trying this on laravel but i m getting error like this

    SQLSTATE[42601]: Syntax error: 7 ERROR: subquery in FROM must have an alias
     LINE 3: (select * from subcategory a inner join s...
    HINT: For example, FROM (SELECT ...) [AS] foo. (SQL: select * from 
    mastercategory c
    inner join 
     (select * from subcategory a inner join subling b on 
    a.idsubcategory=b.idsubcategory_subcategory) on c.idcategory=a.idsubcategory_subcategory
    

    i m trying to join mastercatergory with subquery of join of (subcategory and subling)

       $users = DB::select(DB::raw(" select *  from mastercategory c
                inner join  (select * from subcategory a inner join subling b on 
                a.idsubcategory=b.idsubcategory_subcategory) on 
                c.idcategory=a.idsubcategory_subcategory "))->get();
    

    18th April, 2017

    bipin started a new conversation How To Acomplished This Complex Structure • 1 week ago

    here is my controller

           $users = DB::table('mastercategory')
             ->join('subcategory', 'mastercategory.idcategory', '=', 
             'subcategory.idcategory_mastercategory')
             ->join('subling', 'subcategory.idsubcategory', '=', 'subling.idsubcategory_subcategory')
             ->select('mastercategory.*', 'subcategory.*','subling.*')
             ->get();
    

    here is view

                   <ul>
             @foreach($users as $m)
                        <li> {{$m->namecategory}}
                           <ul>
                                  <li>{{$m->namesubcategory}}
                                     <ul>
                                       
                                            <li>{{$m->namesubling}}</li>
    
    
                                     </ul>
    
    
                                  </li>
    
                           </ul>
    
                       </li>
                
             @endforeach  
                 </ul>
    

    i m getting this kind of structure for eg:-

       1.mobile & accessory(mastercategory)
                1.mobile(subcategory)
                          1.iphone(subling)
        1.mobile & accessory(mastercategory)
                2.mobile  case(subcategory)
                          1.phone cover(subling)
    

    i try to achieve this type of structure how i can achieve this please help

      1.mobile & accessory(mastercategory)
                1.mobile(subcategory)
                          1.iphone(subling)
                2.mobile  case(subcategory)
                          1.phone cover(subling)
    

    bipin started a new conversation SQLSTATE[42P01]: Undefined Table: 7 ERROR: Relation "mastercategory " Does Not Exist • 1 week ago

    here is my controller

        $users = DB::table('mastercategory ')
                    ->join('subcategory', 'mastercategory.id', '=', 'subcategory.id_mastercategory')
    
                    ->select('mastercategory.*', 'subcategory.*')
                    
                    ->get();
                    dd($users);
    

    i have all these table in db why i m getting error using get

    17th April, 2017

    bipin left a reply on How To Create Model For Category Subcategory And Product • 1 week ago

    @Screenbeetle it got my ans by modifing controller $categories = Category1::with(['subcategories','product'])->get(); thanks for you giving your valueable time

    bipin left a reply on How To Create Model For Category Subcategory And Product • 1 week ago

    @Screenbeetle here is my controller

       public function myform(Request $request)
    {
        $categories = Category1::all();
        dd($categories->subcategory->name);
      
        return view('myform1',compact('categories'));
    
    }
    model for category
    
    class Category1 extends Model
    {
    protected $table = 'mastercategory';
    
    protected $fillable = ['id','name'];
    
    
    public function subcategories(){ 
    
        return $this->hasMany('App\Subcategory', 'id_mastercategory');
         }    
    public function products()
    {
    return $this->hasMany('App\product1', 'id_subcategory');}
    }
    model for subcategory
    
     class Subcategory1 extends Model
     {
     protected $table = 'subcategory';
      protected $fillable = [
        'name',
        'id',
        'id_mastercategory'
       ];
    public function category()
     {
      return $this->belongsTo('App\Category1');
     }  
    

    model for product

    class product1 extends Model { protected $table = 'subling';

    protected $fillable = [
        'name',
        'id',
        'id_subcategory'
    ];
      public function category()
     {
    return $this->belongsTo('App\Category1');
    

    } } @Screenbeetle i m using you method as you describe above im using dd($categories->subcategory->name); its says that it doesn't collect subcategory eg:- Property [subcategory] does not exist on this collection instance

    bipin left a reply on How To Create Model For Category Subcategory And Product • 1 week ago

    @Screenbeetle its has only Category table value i want both product as well as subcategory

    bipin started a new conversation How To Create Model For Category Subcategory And Product • 1 week ago

    i have table category,subccategory and product & i want to achieve like this

    1. mobile & accesory(category)
              -mobile(subcategory)
                        -iphone(product)
    
    2.electronics(category)
              -laptops(subcategory)
                       -hp(product)
    

    i want to send all table detail like categoryid,categoryname , subcategoryid, subcategoryname, productid, productname from controller to view so that i cant fetch all these detail in hierarchical way like above mention

    i don't know how to create model and controller for these type of situation please help me guys if any video or refrence it will be great thanks in advance

    12th April, 2017

    bipin started a new conversation Why I Redirecting Default Route Login • 2 weeks ago

    here is my route

    Route::get('/checkout',[ 'uses' => [email protected]', 'as' => 'checkout','middleware' => 'auth'

    ]);
    
    
    Route::post('/checkout',[
        'uses' => [email protected]', 'as' => 'checkout',
        'middleware' => 'auth'
        ]);
    

    i don't want to use inbuilt login function so i create my own.. i m using same middleware auth to protect my route but if i try to login its throw error like Route [login] not defined. acutally i want this route instead of default

     Route::group(['prefix' => 'user'],function(){
    Route::group(['middleware' => 'guest'], function(){
    
    Route::get('/signup',['uses' => [email protected]',
        'as' => 'user.signup'
        ]);
    
    Route::post('/signup',['uses' => [email protected]',
        'as' => 'user.signup'
        ]);
    
    
    Route::get('/signin',['uses' => [email protected]',
        'as' => 'user.signin'
        ]);
    
    Route::post('/signin',['uses' => [email protected]',
        'as' => 'user.signin'
        ]);
    
    });
    

    8th April, 2017

    bipin started a new conversation How To Integrate Google Search In This Modal • 3 weeks ago

    here is my view code i want to integrate a google search. when i m adding a google search then map disappear more over i added a google map api into my view its still not working .i posted a working modal over here and i need help how to integrate google search please help

    Show Map ×Close

    Address

            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">Close</button>
          </div>
        </div>
    </div>
    

         <script type="text/javascript"> 
    

    function init(){ var address = 'india'; var map = new google.maps.Map(document.getElementById('map'), { zoom: 16 }); var geocoder = new google.maps.Geocoder();

        geocoder.geocode({
          'address': address
        }, 
        function(results, status) {
        if(status == google.maps.GeocoderStatus.OK) {
          new google.maps.Marker({
          position: results[0].geometry.location,
          map: map
          });
          google.maps.event.trigger(map, 'resize');
          map.setCenter(results[0].geometry.location);
          }
        });
    }
    
    $('#myModal7').on('shown.bs.modal', function(){
    init();
    });
    

    7th April, 2017

    bipin started a new conversation Modal Google Map • 3 weeks ago

    how i can create a google map view in modal any suggestion

    6th April, 2017

    bipin left a reply on Input Box Using Modal • 3 weeks ago

    i want popup on same page mean parent view how i can acheve this help me

    bipin left a reply on Input Box Using Modal • 3 weeks ago

    yes i m using javascript i m using onclick event on input box but don't know how i can achieve model on input type any more suggestion

    bipin started a new conversation Input Box Using Modal • 3 weeks ago

    when a user click on input type in form. popup window should show up how i can achieve this ? any suggestion i also try modal its not working perfectly how i can achieve this help me

    5th April, 2017

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    i found why i m get null value ($user) in controller it because phontoken field in my database is randomnumber but when i manually enter any value in its throw error mean it $user in controller get null value...... may i know what reason behind this

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    numeric value which i passed from input here is example

    $user = User::where('phonetoken', '0869')->first();

    it give output when i use like this

    $user = User::where('phonetoken', '0869');

    if i remove first

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    migartion

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    @vipin93 phonetoken have value initially has value but after if condition it reset

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    @ bashy Why you saving it as space?

    $user->phonetoken = " "; it just rest it value to null

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    i have column phoneconfirmation and phonetoken in DB and its comparing is correct but don't know why i m getting null value at $user

    3rd April, 2017

    bipin left a reply on Why I M Always Getting Null Value In Laravel • 3 weeks ago

    i m getting value in ($phonetoken) but not in $user

    bipin started a new conversation Why I M Always Getting Null Value In Laravel • 3 weeks ago

    here is my controller i don't know why i have null value i check using dd($user)

    public function success1(Request $request)
    { 
    
     $phonetoken = $request->input('phonetoken');
    
      $user =User::where('phonetoken', $phonetoken)->first();
    
    
       dd($user);
        if(!is_null($user)){
        $user->phoneconfirmed = 1;
        $user->phonetoken = " ";
        $user->save();
    
       return redirect('sellerdashboard');
       }
    
       return redirect()->back();
     } 
    

    why i m not getting value in $user always getting null

    bipin left a reply on Why I M Getting Null Request Value • 3 weeks ago

    here is update controller

       public function success1(Request $request)
    { 
    
         $phonetoken = $request->input('phonetoken');
    
    
        $user =DB::table('users')->where('phonetoken', $phonetoken)->first();
       dd($user);
        if(!is_null($user)){
            $user->phoneconfirmed = 1;
            $user->phonetoken = " ";
            $user->save();
            
          return redirect('sellerdashboard');
        }
    
        return redirect()->back();
     }
    

    user put input in phonetoken after that if value matches then phoneconfirmed and phonetoken should be update for that i m using save method but its show error like this Call to undefined method stdClass::save() how i can solve this help please

    Edit Your Profile
    Update

    Want to change your profile photo? We pull from gravatar.com.