nafeeur10

nafeeur10

Member Since 1 Year Ago

Experience Points
3,450
Total
Experience

1,550 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
8
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 1
3,450 XP
14 Sep
1 week ago

nafeeur10 started a new conversation Read HTML Tag From Database To Blade (Within Owl-carousel)

I will save description as li Like:

<li>ABC</li>
<li>DEF</li>
<li>GHI</li>

Now I want to print in output as they give in real. But within owl-carousel it is going to another slide.

ABC
DEF
GHI

{!! $p->description !!} is not working.

30 Aug
3 weeks ago

nafeeur10 left a reply on Font Awesome Icons Are Not Showing In Live

Then how can I solve it?

29 Aug
3 weeks ago

nafeeur10 started a new conversation Font Awesome Icons Are Not Showing In Live

http://nafidev.com/auth/

To do this I used Laravel, Vue.js, MDBootstrap. But Font Awesome is not working. I don't know why. In local, All icons are coming. What's the wrong?!

17 Aug
1 month ago

nafeeur10 started a new conversation Tooltip On Badge

I tried to show a tooltip for badge. Is it possible in Vuetify?

<v-tooltip bottom>
  <v-badge>
      <template v-slot:badge><span>{{ props.item }}</span></template>
      <span>{{ props.value }}</span>
  </v-badge>
  <span>Tooltip</span>
</v-tooltip>

This code is not working.

26 Jul
1 month ago

nafeeur10 started a new conversation How To Use Class Which Is Created By Ajax Jquery?

$.ajax({
    type: 'POST',
    url: "{{ url('/pos/createSubCategory') }}",
    data: {id: id},
    success: function (data) {

         var html = '';
         if(!$.trim(data))
         {
              html = '<div>' + '<h3>' + 'Empty!' + '</h3>' +'</div>';
         }
         else
         {
               $.each(data, function () {
               html += '<div class="subCategory" data-target="#subcategory_product_modal" data-toggle="modal" aria-hidden="true" data-dismiss="modal"  data-id="'+this.id+'"' + '<p>' + this.name + '</p>' +'</div>';
                        });
          }

          $('#subcategory_Modal_body').html(html);

          },
         error: function (data) {
     console.log(data);
       }
});

Getting data with ajax and passing it to a Bootstrap Modal. It's fine. But when I want to access the data after that, it's not working.

Look at this example:

$(".subCategory").click(function () {
            console.log("You are in right place");
 })

But the class is not clickable.

24 Jul
1 month ago

nafeeur10 left a reply on How To Get Data From Ajax Request?

In Console of Browser.

nafeeur10 left a reply on How To Get Data From Ajax Request?

I have added that. But still now giving 500: Internal Server Error.

nafeeur10 started a new conversation How To Get Data From Ajax Request?

Laravel:

I am calling a POST request from a blade name: create.blade.php

<form>
    <p data-toggle="modal" data-id="{{$category['id']}}" data-target="#subcategory_Modal" class="CategoryIDForModal">BSModal
</p>
</form>

Calling an ajax request in this page:

$(".CategoryIDForModal").click(function (e) {
            var id = $(this).data(id);
            e.preventDefault();

            $.ajax({
                type: 'POST',
                url: 'pos/ajaxRequestForSubCategoryPost',
                data: {id: id},
                success: function (data) {
                    console.log(data.success);
                }
            })
        })

In route:


Route::post('pos/ajaxRequestForSubCategoryPost', '[email protected]');

In Controller:

public function ajaxRequestForSubCategoryPost(Request $request)
{
        $input = $request->all();
        dd($input);
}

But I am not getting any result in dd.

nafeeur10 started a new conversation Passing A Value From Bootstrap Data-id To A Php Variable In Laravel

I have a Button of a Modal. When I will click on that button a data-id is passing to that Modal. How can I put that id into an @php variable in my blade??

22 Jun
3 months ago

nafeeur10 left a reply on Dominate Vue Router With Laravel Router

@HOLLYIT - Not working...........

21 Jun
3 months ago

nafeeur10 started a new conversation Dominate Vue Router With Laravel Router

I am building an application with Laravel and Vue.js. I am using vue router. With this I am controlling all routes. Now, I want to make an url xyz.com/admin which will different (Laravel new route, I want to work with this admin separately). I am using this but not working.

Route::get('/admin/{all}', '[email protected]')->where(['all' => '.*']);
19 Jun
3 months ago

nafeeur10 started a new conversation Refresh Page Without Reloading

I am building an E-commerce website. In this website, there is Sign up and Login system.

When a user will log in he will redirect to Homepage. I used

window.location = '/'

this code. But it is refreshing the whole page. Same for logout.

Please give me a suggestion. https://chaldal.com/ See this example.

18 Jun
3 months ago

nafeeur10 left a reply on V-menu Is Not Working

@BOBBYBOUWMANN - It's not a problem. I kept @click empty before, but it worked fine. Now after given a link it is not working..........

nafeeur10 left a reply on V-menu Is Not Working

@BOBBYBOUWMANN - Seriously I am astonished. Why it is not working.!!

<template>
    <v-toolbar
    app
    fixed
    height="80px"
    color="teal lighten-4"
    clipped-left
    >
        <v-toolbar-side-icon
        @click="changeDrawer"
        ></v-toolbar-side-icon>
        <v-img :src="'img/logo1.png'"
        height="50px"
        width="250px"
        ></v-img>
        <v-text-field
            solo
            append-icon="search"
            label="Search for products (e.g. Honey, Tree etc) "
            class="search-bar"
        ></v-text-field>

        <v-spacer></v-spacer>


        <v-toolbar-items class="hidden-sm-and-down">

    <v-menu offset-y>
     
        <v-btn
          color="green"
          slot="activator"
        >
        <v-icon>expand_more</v-icon>
          <span>Dropdown</span>
        </v-btn>

        <v-list>
          <v-list-tile
            v-for="(i, index) in menuDropDown" 
            :key="index"
            @click=""
          >
          <v-list-tile-title>{{ i.title}}</v-list-tile-title>
          </v-list-tile>
        </v-list>

    </v-menu>
 
      </v-toolbar-items>
    </v-toolbar>
</template>

<script>

import { eventBusForNavigation } from '../../../app.js'

export default {
    data() {
        return {
            items: [
                 { 
                   title: 'Products', 
                   icon: 'shopping_basket',
                   to: '/products', 
                   show: true
                 },

                 { 
                   title: 'Contact', 
                   icon: 'contacts',
                   to: '/contact', 
                   show: true
                 },

                 { 
                   title: 'About Us', 
                   icon: 'business_center',
                   to: '/about', 
                   show: true
                 },

                 { 
                   title: 'Login', 
                   icon: 'account_circle',
                   to: '/login', 
                   show: !User.loggedIn() 
                 },

                //  { 
                //    title: User.name(), 
                //    icon: 'account_circle',
                //    to: '/logout', 
                //    show: User.loggedIn() 
                //  }
               ],
               drawer: true,
               menuDropDown:
               [
                 { title: 'Your Profile' },
                 { title: 'Your Orders' },
                 { title: 'Change Password' },
                 { title: 'Logout' }
               ],
               notifications: [
        'Mike, John responded to your email',
        'You have 5 new tasks',
        'You\'re now a friend with Andrew',
        'Another Notification',
        'Another One'
      ]
        }
    },

    methods: {
        changeDrawer()
        {
          this.drawer = !this.drawer;
          eventBusForNavigation.$emit('drawerEdit', this.drawer);
        }
    }
}
</script>

<style scoped>

.search-bar>i
{
  margin-left: 80px!important;
}



.v-toolbar__items .v-btn:not(.v-btn--floating):not(.v-btn--icon)
{
    height: auto;
    padding: 5px 10px;
    text-transform: none;
    color: white;
}

.v-toolbar__items
{
  height: unset!important;
}

a
{
  text-decoration: none;
}

.routerLink
{
  margin-right: 10px;
}

.menuLink
{
  margin-right: 5px;
}

.search-bar
{
    width: 100%;
    margin-left: 5%;
    margin-right: 5%;
    margin-bottom: 0px!important;
    color: black;
}

.v-input__slot
{
  margin-bottom: 0px!important;
}
</style>

<style>
.v-input__slot
{
  margin-bottom: 0px!important;
}

.v-menu>.v-menu__content
{
  display: block!important;
  top: unset!important; 
  right: 5px;
  left: unset!important;
}
</style>

nafeeur10 started a new conversation V-menu Is Not Working

I want to put a Dropdown menu in Toolbar in Vuetify. But v-menu is not working. List is always showing. Click event is not working on that.

https://ibb.co/TKd0PP2 See this image.

Please see my code

<v-toolbar app fixed height="80px" color="teal lighten-4" clipped-left >

    <v-toolbar-items class="hidden-sm-and-down">

<v-menu offset-y>
 
    <v-btn
      color="green"
      slot="activator"
    >
    <v-icon>expand_more</v-icon>
      <span>Dropdown</span>
    </v-btn>

    <v-list>
      <v-list-tile
        v-for="(i, index) in menuDropDown" 
        :key="index"
      >
      <v-list-tile-title>{{ i.title}}</v-list-tile-title>
      </v-list-tile>
    </v-list>
</v-menu>

  </v-toolbar-items>
</v-toolbar>

03 Feb
7 months ago

nafeeur10 started a new conversation Replace A Component With Router View

I want to load 3 Components at a time like that:

<app-header />
<app-main />
<app-footer />

But I want to load Router View also in this page. When I will click on <router-link> then it <app-main> will be replaced by <router-view>

<app-header />
<router-view />
<app-footer />

While I will click on the router-link then <app-main /> will be vanish and <router-view /> will be visible.

Is there any better way to handle it without if or show?

26 Jan
7 months ago
25 Jan
7 months ago

nafeeur10 left a reply on Two Components In View: Laravel

@WILK_RANDALL - I attached my code. But they are not working.

Do you know, why?

24 Jan
7 months ago

nafeeur10 left a reply on Two Components In View: Laravel

@ROBOROBOK - I am working with Laravel.

nafeeur10 started a new conversation Two Components In View: Laravel

Is it possible to use multiple Components in blade?

I want to divide my code into three sections.

  1. Header
  2. Main
  3. Footer

I want to keep them into root blade like home.blade.php

app.js

Vue.component('app-header', require('./components/front/common/AppHeader.vue').default);
Vue.component('app-login', require('./components/auth/Login.vue'));


const app = new Vue({
    el: '#app'
});

home.blade.php

<div id="app">
        <app-header></app-header>
        <app-login></app-login>
</div>
07 Nov
10 months ago

nafeeur10 started a new conversation Larvel: Single Data Is Not Showing With Ajax In Modal

I have a Modal to show details of Data with this below link:

<a onclick="showProductPricing({{ $customer->id }})">Show</a>

showProductPricing function in ajax:

showProductPricing = function (customerId) {

    save_method = 'show';

    $.ajax({
        url: "{{ url('admin/singleProductPricing') }}" + '/' + customerId,
        type: "GET",
        dataType: "JSON",
        success: function (data) {
            $('#showproductPricing').modal('show');
            $('#productName').val(data.productName);
            $('#productPrice').val(data.productPrice);
        },

        error: function (data) {
            console.log((data));
        }
    });
};

Route:

Route::get('/admin/singleProductPricing/{id}','[email protected]');

Controller:

public function singleProductPrice($id)
{
     $singleProductPrice = ProductPricing::find($id);
     return $singleProductPrice;
}

Blade: I am using Data Table. Which is a Modal. But in modal data is not coming. No info also in console.log

<tr>
   <td><span class="text-danger" id="productName"></span></td>
   <td><span class="text-danger" id="productPrice"></span></td>
</tr>
05 Nov
10 months ago

nafeeur10 started a new conversation Error To Migrate Vanilo Laravel

Trying to install it https://vanilo.io/docs/0.3/installation. While migrating then giving this error.

   Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json not null, `custom_properties` json not null, `responsive_images` json not n' at line 1 (SQL: create table `media` (`id` int unsigned not null auto_increment primary key, `model_type` varchar(191) not null, `model_id` bigint unsigned not null, `collection_name` varchar(191) not null, `name` varchar(191) not null, `file_name` varchar(191) not null, `mime_type` varchar(191) null, `disk` varchar(191) not null, `size` int unsigned not null, `manipulations` json not null, `custom_properties` json not null, `responsive_images` json not null, `order_column` int unsigned null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

nafeeur10 left a reply on Data Is Not Posting. Laravel 5.7

Nothing is coming with dd($request->all());

nafeeur10 left a reply on Data Is Not Posting. Laravel 5.7

@lostdreamer_nl I want to push data in customerId for once but it will contain it's value for all time in the foreach. It will not change with the value of iteration.

nafeeur10 started a new conversation Data Is Not Posting. Laravel 5.7

I have a Product List. Passing id to a Javascript function to set a value in a Bootstrap Modal in the same page.

<table>
    <thead>
        <tr>
            <th>Serial</th>
            <th>Code</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
                       
        @foreach($customers as $customer)
            <tr>
                <td>{{ $customer->id }}</td>
                <td>{{ $customer->customerCode }}</td>
                <td>
                    <a onclick="addProductPricing({{ $customer->id }})" id="addP"></a>
                    <a class="m-r-15 text-muted" id="showDetails" ></a>
                </td>

                              
            </tr>
        @endforeach
    </tbody>             
</table>

Modal has a form with foreach. For first time it is setting the value but for second time it is setting null again.

<div class="modal fade" id="productPricing"">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
               ---
            </div>
            <div class="modal-body">

                <form class="form-horizontal m-t-20"  method="POST" data-toogle="validator" id="addPP-form">
                    @csrf {{ method_field('POST') }}
                   
                    @foreach($products as $product)
                        <div class="form-row product-pricing-div">

                            <input type="hidden" name="customerId" id="customerId" value="">

                            <div class="form-group col-md-12" style="margin-bottom: 0px">
                                <h5 class="right-align">{{ ++$i }}.{{$product->productName }}</h5>
                            </div>

                        </div>
                    @endforeach


                    <div class="modal-footer">
                        <button class="btn" id="addPPbtn" type="submit"></button>
                    </div>
                </form>

            </div>



        </div>
    </div>
</div>

Ajax code to submit this Modal form:

@section('scripts')
    <script type="text/javascript">
        let addProductPricing;
        let editProductPricing;
        let value1;

        $( document ).ready(function() {

            $.ajaxSetup({
                headers: {
                    'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
                }
            });


            addProductPricing = function (customerId) {

                save_method = 'add';
                $('input[name_method]').val('POST');
                $('#productPricing').modal('show');
                $('#productPricing form')[0].reset();
                $('.modal-title').text('Add Product Price');
                $('#addPPbtn').text('Save');
                if(customerId)
                    value1 = customerId;

                $("#customerId").val(value1);
            };


            $(function () {
                $('#productPricing form').on('submit', function (e) {
                    if(!e.isDefaultPrevented())
                    {
                        $("#customerId").val(value1);
                        
                        if(save_method == 'add')
                            url = "{{ url('admin/addProductPricing') }}";

                        $.ajax({
                            url: url,
                            type: "POST",
                            data: new FormData($("#productPricing form")[0]),
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                $('#productPricing').modal('hide');

                                swal({
                                   title: "Good Job!",
                                   text: "You clicked the button!",
                                   icon: "success",
                                   button: "Okay!",
                                   timer: '1000',
                                });
                            },
                            error: function (data) {
                                swal({
                                   title: 'Oops...',
                                   text: data.message,
                                   type: 'error',
                                   timer: '1500'
                                });
                            }
                        });
                        return false;
                    }
                });
            })
        });
    </script>
@endsection

Controller:

public function addProductPricing(Request $request)
    {

        //dd($request);
        foreach($request->productId as $index => $product)
        {
            $productPricing = new ProductPricing();
            $productPricing->productId = $request->productId[$index];
            $productPricing->customerId = $request->customerId;
            $productPricing->productName = $request->productName[$index];
            $productPricing->productPrice = $request->productPrice[$index];
            $productPricing->save();
        }

        return redirect('/admin/allCustomer');
    }

nafeeur10 started a new conversation Load Data To A Input Field

Alert giving Error: [object Object]

I have a dynamic Data List:

<table>
    <thead>
        <tr>
            <th>Serial</th>
            <th>Code</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
                       
        @foreach($customers as $customer)
            <tr>
                <td>{{ $customer->id }}</td>
                <td>{{ $customer->customerCode }}</td>
                <td>
                    <a onclick="addProductPricing({{ $customer->id }})" id="addP"></a>
                    <a class="m-r-15 text-muted" id="showDetails" ></a>
                </td>

                              
            </tr>
        @endforeach
    </tbody>             
</table>

Catching this value using JQuery:

@section('scripts')
    <script type="text/javascript">

        var addProductPricing;

        $( document ).ready(function() {
            addProductPricing = function (customerId) {
                var value = $("#customerId").val(customerId).toString();
                alert(value);
           };
       )};
    </script>
@endsection

I want to set this customerId value to a Modal in the same page.

Modal:

<!-- Modal -->
<div class="modal fade" id="productPricing" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">

                <form class="form-horizontal m-t-20"  method="POST" data-toogle="validator" id="addPP-form">
                    @csrf {{ method_field('POST') }}
                   
                    @foreach($products as $product)
                        <div class="form-row product-pricing-div">

                            <input type="hidden" name="customerId" id="customerId" value="">

                            <div class="form-group col-md-12" style="margin-bottom: 0px">
                                <h5 class="right-align">{{ ++$i }}.{{$product->productName }}</h5>
                            </div>

                        </div>
                    @endforeach


                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        <button class="btn text-center bg-success style-je518ohhlink" id="addPPbtn" type="submit"></button>
                    </div>
                </form>

            </div>



        </div>
    </div>
</div>

Console.log:

0: input#customerId
accept: ""
accessKey: ""
align: ""
alt: ""
assignedSlot: null
attributeStyleMap: StylePropertyMap {size: 0}
attributes: NamedNodeMap {0: type, 1: name, 2: id, 3: value, type: type, name: name, id: id, value: value, length: 4}
autocapitalize: ""
autocomplete: ""
autofocus: false
baseURI: "http://localhost:8000/admin/allCustomer"
checked: false
childElementCount: 0
childNodes: NodeList []
children: HTMLCollection []
classList: DOMTokenList [value: ""]
className: ""
clientHeight: 0
clientLeft: 0
clientTop: 0
clientWidth: 0
contentEditable: "inherit"
dataset: DOMStringMap {}
defaultChecked: false
defaultValue: "3"
dir: ""
dirName: ""
disabled: false
draggable: false
files: null
firstChild: null
firstElementChild: null
form: form.form-horizontal.m-t-20
formAction: "http://localhost:8000/admin/allCustomer"
formEnctype: ""
formMethod: ""
formNoValidate: false
formTarget: ""
height: 0
hidden: false
id: "customerId"
incremental: false
indeterminate: false
innerHTML: ""
innerText: ""
inputMode: ""
isConnected: true
isContentEditable: false
labels: null
lang: ""
lastChild: null
lastElementChild: null
list: null
localName: "input"
max: ""
maxLength: -1
min: ""
minLength: -1
multiple: false
name: "customerId"
namespaceURI: "http://www.w3.org/1999/xhtml"
nextElementSibling: div.form-group.col-md-12
nextSibling: text
nodeName: "INPUT"
nodeType: 1
nodeValue: null
nonce: ""
offsetHeight: 0
offsetLeft: 0
offsetParent: null
offsetTop: 0
offsetWidth: 0
onabort: null
onauxclick: null
onbeforecopy: null
onbeforecut: null
onbeforepaste: null
onblur: null
oncancel: null
oncanplay: null
oncanplaythrough: null
onchange: null
onclick: null
onclose: null
oncontextmenu: null
oncopy: null
oncuechange: null
oncut: null
ondblclick: null
ondrag: null
ondragend: null
ondragenter: null
ondragleave: null
ondragover: null
ondragstart: null
ondrop: null
ondurationchange: null
onemptied: null
onended: null
onerror: null
onfocus: null
ongotpointercapture: null
oninput: null
oninvalid: null
onkeydown: null
onkeypress: null
onkeyup: null
onload: null
onloadeddata: null
onloadedmetadata: null
onloadstart: null
onlostpointercapture: null
onmousedown: null
onmouseenter: null
onmouseleave: null
onmousemove: null
onmouseout: null
onmouseover: null
onmouseup: null
onmousewheel: null
onpaste: null
onpause: null
onplay: null
onplaying: null
onpointercancel: null
onpointerdown: null
onpointerenter: null
onpointerleave: null
onpointermove: null
onpointerout: null
onpointerover: null
onpointerup: null
onprogress: null
onratechange: null
onreset: null
onresize: null
onscroll: null
onsearch: null
onseeked: null
onseeking: null
onselect: null
onselectstart: null
onstalled: null
onsubmit: null
onsuspend: null
ontimeupdate: null
ontoggle: null
onvolumechange: null
onwaiting: null
onwebkitfullscreenchange: null
onwebkitfullscreenerror: null
onwheel: null
outerHTML: "<input type="hidden" name="customerId" id="customerId" value="3">"
outerText: ""
ownerDocument: document
parentElement: div.form-row.product-pricing-div
parentNode: div.form-row.product-pricing-div
pattern: ""
placeholder: ""
prefix: null
previousElementSibling: input
previousSibling: text
readOnly: false
required: false
scrollHeight: 0
scrollLeft: 0
scrollTop: 0
scrollWidth: 0
selectionDirection: null
selectionEnd: null
selectionStart: null
shadowRoot: null
size: 20
slot: ""
spellcheck: true
src: ""
step: ""
style: CSSStyleDeclaration {alignContent: "", alignItems: "", alignSelf: "", alignmentBaseline: "", all: "", …}
tabIndex: 0
tagName: "INPUT"
textContent: ""
title: ""
translate: true
type: "hidden"
useMap: ""
validationMessage: ""
validity: ValidityState {valueMissing: false, typeMismatch: false, patternMismatch: false, tooLong: false, tooShort: false, …}
value: "3"
valueAsDate: null
valueAsNumber: NaN
webkitEntries: []
webkitdirectory: false
width: 0
willValidate: false
__proto__: HTMLInputElement
length: 1
__proto__: Object(0)

nafeeur10 left a reply on Loading Same Id All Time

Yes your are right. Thanks.

I want to bind this value to a input field. But getting error!!

<input type="hidden" name="customerId" id="customerId" value="">

Why it is getting error?!!

addProductPricing = function (customerId) {       
       $('#customerId').val(customerId);
};

nafeeur10 started a new conversation Loading Same Id All Time

In blade I am loading a List of data with various customer->id. But while I am triggering button randomly it is showing id only 2

<a onclick="addProductPricing()" data-whatever="{{ $customer->id }}" id="addP">Add</a>

A Modal will show. And I want to get the ID which I combined with data-whatever But loading only 2

<script type="text/javascript">

        var addProductPricing;

        $( document ).ready(function() {

            addProductPricing = function () {

               $('#productPricing').modal('show');
                var recipient = $('[id=addP]').data('whatever');
                alert(recipient);

            };
)}
</script>

I followed this: https://getbootstrap.com/docs/4.0/components/modal/#varying-modal-content

03 Nov
10 months ago

nafeeur10 left a reply on Set Value To A Form Data

@Cronix okay I will give the <input type="hidden" name="customerId"> line outside the loop.

Please give me a suggestion to do this.

nafeeur10 left a reply on Set Value To A Form Data

Modal:

<div class="modal fade" id="productPricing" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalCenterTitle">Modal title</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">

                    <form class="form-horizontal m-t-20"  method="POST" data-toogle="validator">
                        @csrf {{ method_field('POST') }}

                        <?php
                        $i = 0;
                        ?>

                        @foreach($products as $product)
                            <div class="form-row product-pricing-div">

                                <input type="hidden" name="productId[]" value="{{ $product->id }}">
                                <input type="hidden" name="customerId" id="customerId1">

                                <input type="hidden" name="productName[]" value="{{ $product->productName }}">


                                <div class="form-group col-md-12" style="margin-bottom: 0px">
                                    <h5 class="right-align">{{ ++$i }}.{{$product->productName }}</h5>
                                </div>

                                <!-- Phone Number -->

                                <div class="form-group col-md-12">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text bg-success text-white" ><i class="ti-money"></i></span>
                                        <input type="number" step="any" class="form-control form-control-lg" placeholder="Enter Price for Product {{ $i }}" name="productPrice[]" value="{{ old('customerPhone') }}">
                                    </div>
                                </div>
                            </div>
                        @endforeach


                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                            <button class="btn text-center bg-success style-je518ohhlink" id="addPPbtn" type="submit"></button>
                        </div>
                    </form>

                </div>



            </div>
        </div>
    </div>

nafeeur10 left a reply on Set Value To A Form Data

<table id="zero_config" class="table table-striped table-bordered">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>Name</th>
                       <th>customer Id</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php $i=0;?>
                        @foreach($products as $product)
                            <tr>
                                <input type="hidden" value="{{ $customer->id }}" id="customerId">
                                <td>{{ $product->id }}</td>
                                <td>{{ $product->name }}</td>
                                <td>{{ $product->customerId }}</td>
                                <td>
                                    <a onclick="addProductPricing()" style="cursor: pointer" class="m-r-15 text-muted">Add</a>
                                    <a class="m-r-15 text-muted" id="showDetails" >See</a>
                                </td>                           </tr>
                        @endforeach
                        </tbody>
                        <tfoot>
                        <tr>
                            <th>id</th>
                            <th>Name</th>
                       <th>customer Id</th>
                            <th>Action</th>
                        </tr>
                        </tfoot>
                    </table>

nafeeur10 left a reply on Set Value To A Form Data

Ajak Code:

<script type="text/javascript">
        var addProductPricing;
        $( document ).ready(function() {
            addProductPricing = function () {
                /* alert("YES");
            This function will execute while I will click on Add button of Product List.
        */
                save_method = 'add';
                $('input[name_method]').val('POST');
                $('#productPricing').modal('show');
                $('#productPricing form')[0].reset();
                $('.modal-title').text('Add Product Price');
                $('#addPPbtn').text('Save');

                $('#customerId1').change(function() {
                    $('#customerId').val($(this).val());
                });
            };


            $(function () {
                $('#productPricing form').validator().on('submit', function (e) {
                    if(!e.isDefaultPrevented())
                    {
                        var id = $('#id').val();
                        if(save_method == 'add')
                            url = "{{ url('admin/addProductPricing') }}";

                        $.ajax({
                            url: url,
                            type: "POST",
                            data: new FormData($("#productPricing form")[0]),
                            contentType: false,
                            processData: false,
                            success: function (data) {
                                $('#productPricing').modal('hide');
                                swal({
                                   title: "Good Job!",
                                   text: "You clicked the button!",
                                   icon: "Success",
                                   button: "Great!",
                                });
                            },
                            error: function (data) {
                                swal({
                                   title: 'Oops...',
                                   text: data.message,
                                   type: 'error',
                                   timer: '1500'
                                });
                            }
                        });
                        return false;
                    }
                });
            })
        });
    </script>

nafeeur10 started a new conversation Set Value To A Form Data

I have a form and a data table.

In data table I have a list of Products.

----------------------------------------
id | name| customerId | Action
----------------------------------------
1       Egg       1              Add|See
2      Apple      2              Add|See

When I will click on Add button then a POP up Modal will come with a form. I want to attach my customerId to this form and submit the form.

What will be my procedure.. I am using ajax,

and trying this code...

$('#customerId1').change(function() {
         $('#customerId').val($(this).val());
});

Getting customerId1 value from the list and customerId is a hidden input field in the Modal form

But don't getting any result.

31 Oct
10 months ago

nafeeur10 left a reply on Composer Update Hangs

@PrashanthThugaiah Have you solved this issue??

nafeeur10 left a reply on Laravel Datatables Is Not Installing With Composer

Same Problem. Not working...

Loading composer repositories with package information
Updating dependencies (including require-dev)
30 Oct
10 months ago

nafeeur10 started a new conversation Laravel Datatables Is Not Installing With Composer

Trying to install Laravel Datatables. But it not working and hanging in here:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

How to install it manually??

nafeeur10 started a new conversation Show Product Details In Bootstrap Modal: Laravel 5.6

Hi, I have a List of Products. Now I want to show details of a Product in a Bootstrap Modal. Then how will I retrieve data from database for this single product?

28 Oct
10 months ago

nafeeur10 left a reply on OrderBy Is Not Working: Laravel 5.6

Yes. They are all in ascending order. https://pasteboard.co/HKuoKWA.png

27 Oct
10 months ago

nafeeur10 left a reply on OrderBy Is Not Working: Laravel 5.6

Not working...... I don't know why!! I am giving you correct answer.

It will be ->with(compact('customers');

nafeeur10 left a reply on OrderBy Is Not Working: Laravel 5.6

It should work. But not working....

Controller:

$customers = DB::table('customers')->orderBy('id', 'desc')->get();
        return view('customer.allCustomer',['customers'=>$customers]);


@foreach($customers as $customer)
            <tr>
                <td>{{ $customer->id }}</td>
                <td>{{ $customer->customerCode }}</td>
                <td>{{ $customer->customerDriver }}</td>
            </tr>
@endforeach 

nafeeur10 left a reply on OrderBy Is Not Working: Laravel 5.6

Getting result in Ascending Order.

View:

@foreach($customer as $customer)
                            <tr>
                                <td>{{ $customer->id }}</td>
                                <td>{{ $customer->customerName }}</td>
                                <td>{{ $customer->customerEmail }}</td>                            
                            </tr>
@endforeach

nafeeur10 started a new conversation OrderBy Is Not Working: Laravel 5.6

Trying to get id from last to first. Using this code but is not working.

$customer = DB::table('customers')->orderBy('id', 'desc')->get();

26 Oct
10 months ago

nafeeur10 left a reply on Two Form One Submit Button

Hi @Cronix , Actually it's not Laravel Built in Auth actually. So, I can proceed with your suggestion. Please give me another suggestion.

16 Oct
11 months ago

nafeeur10 left a reply on Route [customer.addProductPricing] Not Defined.

Please see this code:

I want to save a Customer then Want to pass that Customer's Id to a View.

public function addCustomer(Request $request)
    {
        $customer = new Customer();

        $customer->customerCode = $request->customerCode;
        $customer->customerDriver = $request->customerDriver;
        $customer->customerCompanyName = $request->customerCompanyName;
        $customer->customerAddress = $request->customerAddress;
        $customer->customerPostalCode = $request->customerPostalCode;
        $customer->customerPhone = $request->customerPhone;
//        $customer->customerProductsPricing = $request->customerProductsPricing;
        $customer->customerBillingCycle = $request->customerBillingCycle;
        $customer->customerRemarks = $request->customerRemarks;
        //$customer->productId = NULL;
        
        $customer->save();

        $customerId = $customer->id;
        //dd($customerId);

        return Redirect()->route('customer.addProductPricing', ['customerId' => $customerId ])->with('flash_message_success', 'New Customer Added Successfully!');
    }

nafeeur10 left a reply on Route [customer.addProductPricing] Not Defined.

@Cronix You are right. But in Blade..

Undefined variable: customerId (View: E:\Nafeeur\Work\xampp\htdocs\pos\resources\views\customer\addProductPricing.blade.php)

nafeeur10 left a reply on Route [customer.addProductPricing] Not Defined.

Route::post('/admin/addProductPricing', '[email protected]');
``

nafeeur10 started a new conversation Route [customer.addProductPricing] Not Defined.

I am using Redirect but is not working. I have a view "addProductPricing" under "customer"

$customerId = $customer->id;

return Redirect()->route('customer.addProductPricing', ['customerId' => $customerId ])->with('flash_message_success', 'New Customer Added Successfully!');
``

nafeeur10 left a reply on Pass Array From Blade To Controller To DB

For showing. I want to save product wise price. So, When I will show, I want to show Product Name and Price.