bipin

Experience

4,120

3 Best Reply Awards

  • Member Since 3 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

27th June, 2017

bipin started a new conversation How To Share Auth View As Well As Sidebar Data With All View • 4 hours ago

hi guys so far i had create a sidebar menu whose value (name) getting from DB and its working properly but when i try to verify whether a user is superadmin or user then its should share view $sa(superadmin) otherwise it should share view $ca (user)how i can achieve these thing need suggestion

AppServiceProvider view

              public function boot()
     {
     //dd(Auth::user());
    if(DB::table('user')->where('role','superadmin')->get()){
         $sa=DB::table('master')>join('page','master.id'=page.id)
      ->get();
   View::share('sa', $sa);
    }

     if(DB::table('user')->where('role','user')->get()){
         $ca=DB::table('master')>join('page','master.id'=page.id)
     where(master.role_id=2) ->get();
    View::share('ca', $ca);
  }
   }

auth user return null is also try view composer nothing worked so far

26th June, 2017

bipin started a new conversation How To Make Dynamic Menu • 18 hours ago

hi guys so far i had create a sidebar menu whose value (name) getting from DB and its working properly but when i try to verify whether a user is superadmin or user then its should share view $sa(superadmin) otherwise it should share view $ca (user)how i can achieve these thing need suggestion AppServiceProvider view

      public function boot()
   {

    if(DB::table('user')->where('role','superadmin')->get()){
             $sa=DB::table('master')>join('page','master.id'=page.id)
     ->get();
  View::share('sa', $sa);
  }

   if(DB::table('user')->where('role','user')->get()){
             $ca=DB::table('master')>join('page','master.id'=page.id)
    where(master.role_id=2) ->get();
  View::share('ca', $ca);
  }
    }

22nd June, 2017

bipin started a new conversation How To Fetch Relation Array Or Verifiy • 4 days ago

here guys i stuck what condition should i apply so need your help i had developed relationship between menu & submenu model where menu has many submenu its work fine here is my data stucture

       1.product---(menu table)
              1.addnew        --(submenu)
              2.listproduct   --(submenu)
        2.setting        ---(menu table)
              1.addcate         --(submenu)
              2.addsubcat   --(submenu)
       3.people

this is what i m getting from relation query i.e from model it work perfectly but my issue is that i want to put condition in mmy view if menu table does not have submenu then its should print this

            @if (empty($d->subMenu)
                   <li class="mm_welcome"><a href="{{url($d->menuurl)}}"><i class="fa fa-
             dashboard"></i> <span>{{$d->name}}</span></a></li>
             
                  @endif   

and if it have both menu and submenu table then it should go in this condition need your help

         @foreach($cat as $d)
         

             <li class="mm_welcome">
                <a href="#">
                    <i class="fa fa-barcode"></i>
                    <span>{{$d->name}}</span>
                    <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                 @foreach($d->subMenu as $s)
                    <li id="products_index"><a href="{{url($s->suburl)}}"><i class="fa fa-circle-o">
                   </i> {{$s->name}}</a></li> 
                   @endforeach 
                </ul>
            </li>
            
        @endforeach 

9th June, 2017

bipin left a reply on Relationships Not Working • 2 weeks ago

i think you need these thing just follow these thing carefully

https://laracasts.com/discuss/channels/laravel/invalid-argument-supplied-for-foreach-12

https://laracasts.com/discuss/channels/laravel/how-to-create-model-for-category-subcategory-and-product just go through carefully you will find your answer hope this help

bipin left a reply on HOW I CAN FETCH ORIGINAL ATTRIBUTE VALUE • 2 weeks ago

@Snapey #original: array:10 [▶] contain product id which i want so that i can update my product(table) value

bipin left a reply on HOW I CAN FETCH ORIGINAL ATTRIBUTE VALUE • 2 weeks ago

@tykus actually all value are stored in my cart variable, i had also try cart variable to fetch original array just for knowledge.. $cart->getoriginal(); but get nothing

bipin left a reply on HOW I CAN FETCH ORIGINAL ATTRIBUTE VALUE • 2 weeks ago

@Snapey its actually contain id of some product and other value so just want to know is there any method to fetch these value

bipin left a reply on HOW I CAN FETCH ORIGINAL ATTRIBUTE VALUE • 2 weeks ago

@tykus its throw Undefined variable: items can you brief about getoriginal() attribute

8th June, 2017

bipin started a new conversation HOW I CAN FETCH ORIGINAL ATTRIBUTE VALUE • 2 weeks ago

hello guys i m too curious to know weather is there any method to find value of these thing

        Cart {#281 ▼
    +items: array:2 [▼
         1 => array:3 [▼
              "qty" => 2
              "price" => 20000
              "item" => Sellerproduct {#278 ▼
              +table: "sellerproduct"
               #connection: "pgsql"
               #primaryKey: "id"
               #keyType: "int"
              +incrementing: true
              #with: []
              #perPage: 15
               +exists: true
               +wasRecentlyCreated: false
               #attributes: array:10 [▶]
                #original: array:10 [▶]
                #casts: []
                #dates: []
                #dateFormat: null
                #appends: []
                #events: []
                #observables: []
                #relations: []
                #touches: []
               +timestamps: true
              #hidden: []
               #visible: []
              #fillable: []
            #guarded: array:1 [▶]
              }
               ]
             3 => array:3 [▶]
             ]
             +totalQty: 4
            +totalPrice: 20540
             }

is there any method to know what #original: array:10 [▶] contain (mean what it have value) please guys help if search a lot on internet but did not find any solution

30th May, 2017

bipin left a reply on Seller Product Quantity Value Decrements Not Work • 4 weeks ago

fetch data from database and store it into any variable for eg:-$s and use this also

       $q=$cart->totalquantity 
         $r=$s-$q
      DB::table('tablename')
    ->where('id',$id) 
    
    ->update(array('quantity' => $r)); 
    
    

bipin left a reply on Check User Is Verified After Login • 4 weeks ago

@moto yes it possible, but it increase you route which will reduce performance if you still require then create new controller where you can place all your common logic (means check user) and from there redirect it to other controller using route

bipin left a reply on Check User Is Verified After Login • 4 weeks ago

@moto i think you modify in vendor folder

bipin left a reply on Multi Step Authentication • 4 weeks ago

create controller with same function method which are using in core.... in this way you can override method this means that it first check you controller you defined method.. do not override you core code its bad practise

26th May, 2017

bipin left a reply on Values Stored In Session Are Not Displaying In Array • 1 month ago

try to use this

   $request->session()->all('');

24th May, 2017

bipin left a reply on Button Changed Script • 1 month ago

yes he need to change button from add to cart to go to cart after click ?

23rd May, 2017

bipin left a reply on Session Table Columns • 1 month ago

use this hope it will help $value = $request->session()->get('key');

bipin left a reply on How To Auth With Laravel 5.4 • 1 month ago

this error arise because of predefine code in vendor folder which version you are using of laravel

bipin left a reply on How To Send Array To Server From Input Text • 1 month ago

just save array of request data directly into database for eg

DB::insert('insert into ''('where you want to enter) values(?)',[request->input::all()]);

19th May, 2017

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

@Snapey name='result[i]name' ,array has only single value here is my dd value

   array:1 [▼
          "i" => "6"
       ]

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

@Snapey here i m script form $(document).ready(function(){ var inp = $('#box');

    var i = $('input').size() + 1;
      @foreach($result as $s)
                @if($s->fieldtype=='text')
    $('<div id="box' + i +'"><input type="text" id="name" class="name" 
     name="name[][name]" /></div>').appendTo($('#box form'));
     $('<div id="box' + i +'"><input type="hidden"  name="name[][id]"  
      value="{{$s->id}}"></div>').appendTo($('#box form'));
   
              @elseif($s->fieldtype=='textarea')

        $('<div id="box' + i +'"><input type="textarea" id="name" class="name" 
     name="name[]" /></div>').appendTo($('#box form'));

     @endif
      i++;
                  @endforeach     
     });
     </script>

i m getting value( like text) from database('detailtbl') then script append input type text & it appear at client side(viewpage) after this client enter some value in input type and save it

what i need is i m trying to save id of detail table and input value of client at new database (mastertbl)

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

@Snapey i m trying to save array of data into database column but i don't know how to code in controller

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

its not work you code is wrong it only fetch name not id from an array

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

@AhimbisibweRoland its not working its throw error

         Array to string conversion

i want to insert these array value in increasing order

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

yes at start i had post a result

bipin left a reply on How I Can Store These Array Value In Same Row • 1 month ago

@topvillas i have id and column but don't know how to code in controller little with confuse here is my controller

   public function insert1(Request $request)
  {
   $dd($request->get('name'));


 foreach($request->get('name') as $name) {
  DB::insert('insert into mastertabledetail (name,id) values(?,?)',[$name]);

 
 }

}

18th May, 2017

bipin started a new conversation How I Can Store These Array Value In Same Row • 1 month ago

here is what i get from dd array:6 [▼ 0 => array:1 [▼ "name" => "werf" ] 1 => array:1 [▼ "id" => "2" ] 2 => array:1 [▼ "name" => "df" ] 3 => array:1 [▼ "id" => "3" ] 4 => array:1 [▼ "name" => "ngf" ] 5 => array:1 [▼ "id" => "4" ] ] how i can store this value in database for eg:- i want to store name in name column and id in id column of my table any suggestion???

17th May, 2017

bipin left a reply on Populate 3 Different Models From One Big Array With Relations • 1 month ago

@R3l4x3 use foreachloop in you controller

16th May, 2017

bipin left a reply on $error Disapear After One Second When Validator Fail • 1 month ago

or try this

  return redirect()->back()->withInput($request 
                >only('email','phone','anything which you are requesting'));

bipin left a reply on $error Disapear After One Second When Validator Fail • 1 month ago

put required in html it will prevent clearing of hole thing for eg:- Username:

bipin left a reply on $error Disapear After One Second When Validator Fail • 1 month ago

@dexluce what problem exaclty you have ? are you trying to see error message for a long time ?

bipin left a reply on $error Disapear After One Second When Validator Fail • 1 month ago

for redirect use these thing

              use Illuminate\Http\Request;
              use App\Http\Requests;
              use Illuminate\Http\RedirectResponse;
 
            return Redirect()->back(); 

hope this help

bipin started a new conversation How I Can Create Dynamic Form • 1 month ago

how i can achieve this. suppose seller select category of mobile then form (input field type should be generated according to mobile type for eg mobile name,mobile description ,feature etc and if he select cover then form should be according to cover for eg:- cover length, cover size etc) i have lot of category list electronic, home etc

category list 1.mobile and accessory 1.mobile 2.cover

for that i have created detail table where i have field name and field type if field type is text then i had write a javascript for that

  @if($s->fieldtype=='text')    
   $("#form1").append('<div class="row"><label>{{$s->fieldname}}</label><input 
        type="text" name="name[]" id="name.concat({{$s->id}})"><input type="hidden" 
       name="name[]" id="ido.concat({{$s->id}})" value="{{$s->id}}"></div>');

this script create input if its get field type text from database. i have done so far but don't know how to achieve futher for eg :- how to save input value to database , input field is not fix it can be more than one also please help

15th May, 2017

bipin left a reply on Why Ajax Not Post Method Not Working • 1 month ago

@d3xt3r its throwing new error like POST http://localhost/home/public/select2 500 (Internal Server Error) jquery.min.js:4

bipin left a reply on Why Ajax Not Post Method Not Working • 1 month ago

Failed to load resource: the server 
   responded with a status of 500 (Internal Server Error)          
/home/public/select1/jqueryform.css


   Failed to load resource: the server 
   responded with a status of 500 (Internal Server Error)

 7/home/public/select1/select2 
  Failed to load resource: the server 
 responded with a status of 500 (Internal Server Error)

jqueryform.css Failed to load resource: the server responded with a status 
of 500 (Internal Server Error)

bipin started a new conversation Why Ajax Not Post Method Not Working • 1 month ago

i m try to send array of data to my controller using ajax but its does nothing its frustrating help anybody

here is my view

D

 <div id="form1">
 <input type="hidden" name="_token"   id="csrf-token" value="{{ Session::token() }}" /> 
</div>
    <div >  <input type="submit" name="submit" type="button" id="submit">
            </div>
            
        </form>

            </div>       
                    <script type="text/javascript">
                    $(document).ready(function() {
                    
    var i=0;
    var input=[];
                    @foreach($result as $s)
                    
                    @if($s->fieldtype=='text')
                    
                     $("#form1").append('<div class="row"><label>{{$s->fieldname}}
      </label>
     <input type="text" name="name" id="name.concat({{$s->id}})"><input type="hidden" 
     name="name" id="ido.concat({{$s->id}})" value="{{$s->id}}"></div>');
                    
                       
                     @elseif($s->fieldtype=='textarea')
                     $("#form1").append('<div class="row">{{$s->fieldname}}<input 
   type="text" id="name.concat({{$s->id}})"><input type="hidden" id="ido.concat({{$s->id}})" 
    value="{{$s->id}}" > </div>');
                     
                     @endif
                     input[i++] = document.getElementById("name.concat({{$s-
                              >id}})").value;

                      @endforeach

                  $("#submit").click(function() {
                     $.ajax({
                url:"/select2",
                type: "POST",
                dataType:"json",
                contentType: "application/json",

               data: {"data": input[i++], "_token" : $("#_token").val()}
            });

        });
       });

here input field type is created by from database above code is working but its not posting any data and i don't know why this happen

12th May, 2017

bipin left a reply on Problem Migrating Table After Creating Students Table • 1 month ago

for student write like this

       public function up()
    {
        Schema::create('students', function (Blueprint $table) {
            $table->increments('id');   or 
             $table->string('std_id');   
            $table->string('std_name');
            $table->string('std_email')->unique();
            $table->string('std_password');
            $table->rememberToken();
            $table->timestamps();
            });
    }

    public function down()
    {
          Schema::dropIfExists('students');
    }
 }

bipin left a reply on Problem Migrating Table After Creating Students Table • 1 month ago

what syntax you have in user table?

bipin left a reply on Problem Migrating Table After Creating Students Table • 1 month ago

delete all table as well as migrate table from you database

29th April, 2017

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

Thanks @saurabhd

bipin left a reply on How To Pass Value From Js To Controller • 1 month 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 month 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 • 2 months 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 • 2 months 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 • 2 months ago

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

bipin left a reply on Forloop Is Not Working • 2 months ago

Then how I can achieve need help

bipin started a new conversation Forloop Is Not Working • 2 months 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 • 2 months ago

if found my soultion

bipin started a new conversation How I Can Submit This Dynamically Jquery • 2 months 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 • 2 months ago

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

Edit Your Profile
Update

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