nafeeur10

nafeeur10

Member Since 1 Year Ago

Experience Points 3,110
Experience Level 1

1,890 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.

22 Jun
1 month ago

nafeeur10 left a reply on Dominate Vue Router With Laravel Router

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

21 Jun
1 month 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
1 month 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
1 month 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.!!

<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>

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);
    }
}

}

.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; }

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

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

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
5 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
5 months ago
25 Jan
5 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
5 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
8 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:

Show 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

05 Nov
8 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

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>

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
8 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

id Name customer Id Action @foreach($products as $product) {{ $product->id }} {{ $product->name }} {{ $product->customerId }} @endforeach id Name customer Id Action ```

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());
});

But don't getting any result.

31 Oct
8 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
8 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 left a reply on Show Product Details In Bootstrap Modal: Laravel 5.6

I think it will be a Dynamic ID for button. I have no id with url. So, how I will get id from this List with that Button? How to attach my id with Button...

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
8 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
8 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.

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.

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
8 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
9 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.

nafeeur10 started a new conversation Pass Array From Blade To Controller To DB

I want to pass array from Blade to Controller. Then with foreach loop I want to pass these data to my DB

In Blade:

@php ($productPrice = [])
@php ($productName = [])
@php ($productId = [])

@foreach($product as $product)
     <input type="hidden" name="productId[]" value="{{ $product->id }}">
     <input type="hidden" name="productName[]" value="{{ $product->productName }}">
     <input type="number" name="productPrice[]" value="{{ old('customerPhone') }}">
@endforeach 

In Controller:
I want to pass data to DB with this way with foreach:

$productPricing = new ProductPricing();
//dd($request);

$productPricing->productId = $request->productId;
$productPricing->productName = $request->productName;
$productPricing->productPrice = $request->productPrice[1];

$productPricing->save();
``
Please show me the way......
14 Oct
9 months ago

nafeeur10 left a reply on Two Form One Submit Button

It will be a Sign Up form for a Customer. I want to give his personal information in a form and we have some products. Products prices will vary from user to user. So I need to save the products with prices for each customer. That's why I need another form. For saving Products Pricing for each Customer. I think you got my point.

nafeeur10 left a reply on Two Form One Submit Button

Please tell me how to start and end code in this discussion.

nafeeur10 started a new conversation Two Form One Submit Button

I have two form with two different route and controller. How can I submit these two forms with one submit button?

<form method="post" url="{ '/url1' }">
</form>

<form method="post" url="{ '/url2' }">
</form>

<button type="submit">Submit</button>
``

I don't want to use AJAX.
07 Oct
9 months ago

nafeeur10 left a reply on How To Pass Data From Method To Computed Property


new Vue({
    el: '#exercise',
    data: {
        changeColor: false
    },

    methods : {
        startEffect: function() {
            let self = this;

            setInterval(function(){
                 self.changeColor = !self.changeColor;
                 //alert(this.changeColor);
            }, 2000);

            //alert(this.changeColor);
        }, 


    }
})

HTML

<div>
    <button @click="startEffect">Start Effect</button>
    <div id="effect" v-bind:class="{ highlight: changeColor, shrink: !changeColor}"></div>
  </div>``

nafeeur10 left a reply on How To Pass Data From Method To Computed Property

Yes you are right. But It is changing for one time!! It should change after two seconds.

nafeeur10 left a reply on How To Pass Data From Method To Computed Property

Then what is your idea to solve this problem?

nafeeur10 started a new conversation How To Pass Data From Method To Computed Property

I am learning Vue JS. I want to change class using setInterval. But can’t pass the changing value of Method to Computed Property.

My Code:

HTML:

<div>
    <button @click="startEffect">Start Effect</button>
    <div id="effect" :class="myClass"></div>
</div>
CSS:

#effect {
  width: 100px;
  height: 100px;
  border: 1px solid black;
}

.highlight {
  background-color: red;
  width: 200px !important;
}

.shrink {
  background-color: gray;
  width: 50px !important;
}
Vue JS:

new Vue({
    el: '#exercise',
    data: {
        changeColor: false
    },

    methods : {
        startEffect: function() {
            setInterval(function(){
                 this.changeColor = !this.changeColor;
                 //alert(this.changeColor);
            }, 2000);

            //alert(this.changeColor);
        }
    },

    computed: {
        myClass: function() {
            return {
                highlight: this.changeColor,
                shrink: !this.changeColor
          }
        }
    }
})``