AbdulBazith

AbdulBazith

Member Since 10 Months Ago

Tamil Nadu, Tirunelveli

Experience Points 11,570
Experience Level 3

3,430 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 0
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

21 Mar
14 hours ago

AbdulBazith left a reply on Php Version Problem When Deploying Laravel Project

@snapey thank you so much for you response..

ya i understood. hereafter the applications which we develop will be php 7.

but now there are few projects which have php 5.4..

i cant remove that.

just now i checked my laravel applciation php version in cmdprmpt.

by giving /projectdirectory/$ php -v

it shows

PHP 7.2.6 (cli) (built: May 23 2018 20:51:04) ( ZTS MSVC15 (Visual C++ 2017) x86
 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies


now what should i do??

is there any solution to deploy my project??

AbdulBazith left a reply on Hosting Shows Error Msg Http 500 Error

@ty thank you so much for you reponse.

the php version is the problem. i changed my php cpanel version to 7.2 and the application worked correctly.

but my other applications are not working what to do?

i have posted it as seperate question kindly if possible respond to it please.

refer: https://laracasts.com/discuss/channels/laravel/php-version-problem-when-deploying-laravel-project

AbdulBazith started a new conversation Php Version Problem When Deploying Laravel Project

Guys i need to deploy a laravel project in cpanel.

i deployed. but i got error http error 500

i found many solutions and at lasti found that php version is the problem.

when i am developing the project in local i used php 5.6.4 version

"require": {
        "php": ">=5.6.4",


now i deployed the project.

my cpanel php version is 5.4.

so i changed the version 5.4 to 7.2 in my cpanel. my apllication started working in live.

but other project which are hosted got error because those projects are developed with php 5.4 version.

so for those project it showing error.

Call to undefined function mysql_connect()

this error is because of in php 7 it is changed to mysqli_connect.

but i cant change all the projects.

if i change the cpanel php version to 5.6. all other projects running correctly, but my laravel showing error

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)

syntax error, unexpected ':', expecting ';' or '{'

what can i do?? can i reduce my laravel application to lower version of php?? is it possible??

the main problem is if my cpanel php version is 7 and above my laravel works correctly, but other projects not.

if i change my php version in cpanel to 5.4 all other works correct but my laravel shows error http error 500

ig i change my php version in cpanel to 5.6 all other works correctly but my laravel shows error Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN) syntax error, unexpected ':', expecting ';' or '{'

now what should i do??

i think better to reduce my laravel php version.

but how, will it affect any functionality of the application??

Kondly suggest you ideas please

20 Mar
1 day ago

AbdulBazith started a new conversation Hosting Shows Error Msg Http 500 Error

Guys i have done a project in laravel

now i tried to host it in shared domain.

actually there is no seperate domain for this project. so my boss decided to host it in owr domain itself with a name demosoft

what i did is

i login into our cpanel

and i moved to public_html

there i created demosoft folder.

then i uploaded my laravel project inside this demosoft folder.

after that i did tow things

  1. moved the files(index, httaccess,etc) from public folder to this demosoft.

  2. opened the index file and change require __DIR__.'/../../bootstrap/autoload.php'; this to

require __DIR__.'/bootstrap/autoload.php';

now i tried to run,

but showing error http error 500

what to do how should i upload it

am i right in upload???

azasoft.in/demosoft this is the link to work

azasoft.in is our personal site. demosoft inside my project

how to do this??

AbdulBazith left a reply on Calculation Problem In Javascript, Showing NaN Error

@diegoaurino thank you for you response.

Number()??

How to use that and where to use?

AbdulBazith left a reply on How To Make A Printout In Laravel

@sergiu17 thank you for your response.

i used barryvdh/laravel-dompdf to make that print out.

thats ok for me.

but i need page number for the print out.

i have posted it as separate question if possible answer those also

Refer: https://laracasts.com/discuss/channels/laravel/how-to-give-page-numbers-for-printout-in-barryvdhlaravel-dompdf

and

Refer: https://laracasts.com/discuss/channels/javascript/calculation-problem-in-javascript-showing-nan-error

Kindly reply for these also please

AbdulBazith started a new conversation Calculation Problem In Javascript, Showing NaN Error

Guys iam working with a project Inventory control.

i have a purchase order form.

in that form i have array of textboxes in row format.

so if admin needs he can add new rows.

this is my blade file

 <td>
        <input type="text" class="rate_per_kg" name="total_qty[]"  />
    </td>

  <td>
        <input type="text" class="rate_per_kg" name="rate_per_kg[]"  />
    </td>

 <td>
        <input type="text" class="discount_amount" name="discount_amount[]"  />
    </td>

<td>
        <input type="text" class="total_amount" name="total_amount[]"  />
    </td>



<td>
        <input type="text" class="grand_total" name="grand_total"  />
    </td>



i tried validation for this that worked fine for me.

this is the validation for total_rate[]

var total_rate = document.getElementsByName('total_rate[]');

for (var i = 0; i < total_rate.length; i++) {
    if (total_rate[i].value == "") {
        alert("Fill the Total Rate");
        total_rate[i].focus();
        return false;
    }
}

this works fine. if admin leaves the total_rate[] empty then alert is displayed and focused.

Now my question is i need to perform calculation also.

so i followed the same technique

whats my calculation is. the total_qty[] column will be filled automatcaiily when page refreshed.

so when admin enters the total_rate[]. so total_qty/total_rate the total_rate divided by total_qty must be done and the result must be displayed in the third column rate_per_kg[]

so for this i followed.

for (var i = 0; i < total_rate.length; i++) {
  var total_rate= total_rate[i].value;
   var total_qty = total_qty [i].value;
 var rate_per_kg=total_rate/total_qty ;
 rate_per_kg[i].value = rate_per_kg;
}

this works for me for the first row only. but in the second row rate_per_kg NaN is displayed.

and also there is a error in the console

1:472 Uncaught TypeError: Cannot read property 'length' of undefined

why?

that calculation must be done for the first row only. how this is possible??

this is the screen shot of that

Refer: https://imgur.com/DQOLsv7

actually i asked the question more that 3 times in the forum. but i cant get it.

now i have the loop and also the calculation.

i think there is a small error.

ithink the for loop is running for all the rows.

Kindly some one help please.

AbdulBazith started a new conversation How To Give Page Numbers For Printout In Barryvdh/laravel-dompdf

Guys iam working with a project Inventory control

i need to take a print out for the purchase order.

i used barryvdh/laravel-dompdf to make it as pdf and then to take printout.

now the print out is fine.

this is my controller


public function printpdf($id)
    {

        $pur_list_det = PurchaseOrder::where('id', $id)->first();

        $orderlists = OrderList::where ('login_user_id',auth()->id())->where('purchase_order_id',$id)->orderBy('updated_at','desc')->get();

        // return view('Purchase.manage-order-list')->withPur_list_det($pur_list_det)->withOrderlists($orderlists);

        $pdf=PDF::loadView('Purchase.printpdf', [
            'pur_list_det' => $pur_list_det,
            'orderlists'=>$orderlists,
            ]);

            $pdf->setPaper('A4','portrait');

            return $pdf->stream('print.pdf');
    }

and this is my printpdf.blade file


<!DOCTYPE html>

<head>
    <style>
        #design {
            font-family: Serif;
            border-collapse: collapse;
            width: 100%;
        }

        #design td,
        #design th,
        #design thead {
            border: 1px solid #000;
            font-size: 12px;
        }

        #design1 {
            font-family: Serif;
            width: 100%;
        }

        #design1 td,
        #design1 th,
        #design1 thead {
            border: none;
            font-size: 12px;
        }
    </style>
</head>

<body>
    <table id="design1">
        <tr>
            <td><b>Order Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->order_date)->format('d-m-Y') }}</td>

            <td><b>Order Time: </b> {{ $pur_list_det->order_time }}</td>

            <td><b>Order ID : </b> {{ $pur_list_det->pur_order_num }}</td>

        </tr>

        <tr>
            <td><b>Supplier: </b> {{ $pur_list_det->supplier->sup_name }}</td>

            <td><b>Expected Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->expec_date)->format('d-m-Y') }}</td>

            <td><b>Expected Time: </b> {{ $pur_list_det->expec_time }}</td>

        </tr>
    </table>

    <caption>
        <h3 align="center"><br>ORDER DETAILS</h3>
    </caption>

    <table id="design">
        <thead>

            <tr>
                <th>S.No</th>
                <th>Product</th>
                <th>Quantity</th>

            </tr>
        </thead>
        <tbody>
            @php ($s_no = 1)

            @foreach($orderlists as $orderlist)
            <tr>

                <td>{{ $s_no }}</td>
                <td>{{ $orderlist->product->product_name }}</td>
                <td>{{ $orderlist->qty }}</td>

            </tr>

            @php ($s_no++)
            @endforeach

        </tbody>
    </table>
</body>

</html>


but what my boss is saying is, he need page number for the printout pages.

how to do this??

and also he need the top portion


<table id="design1">
        <tr>
            <td><b>Order Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->order_date)->format('d-m-Y') }}</td>

            <td><b>Order Time: </b> {{ $pur_list_det->order_time }}</td>

            <td><b>Order ID : </b> {{ $pur_list_det->pur_order_num }}</td>

        </tr>

        <tr>
            <td><b>Supplier: </b> {{ $pur_list_det->supplier->sup_name }}</td>

            <td><b>Expected Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->expec_date)->format('d-m-Y') }}</td>

            <td><b>Expected Time: </b> {{ $pur_list_det->expec_time }}</td>

        </tr>
    </table>



the above portion in all pages, because this protion contains the order Id, supplier name, order date, order time, expected date, expected time so these portion must be repeated in all pages how to do that

Kindly reply please

AbdulBazith left a reply on How To Make A Printout In Laravel

@screenbeetle thank you for your response.

i will try the stream and i will respond..

AbdulBazith left a reply on How To Make A Printout In Laravel

@sergiu17 thank you for you response.

this worked. but my nav bar also viewing in the print.

i need only the specific center portion of the purchase order

how could i do that? please

19 Mar
2 days ago

AbdulBazith started a new conversation How To Make A Printout In Laravel

Guys iam working with a project Inventory control system.

when a purchase order is done i need to take a print out.

i have a button while viewing the purchase order.

when i click that it should move to printer and make a print.

how to do this?

actually in my old milfarm project what i did is i used barryvdh/laravel-dompdf

i made a separate html file with css. then using the above package, i made it as download.

after that user needs to move to the downloaded location and open it as pdf then they can download.

but this client not need of downloading it as pdf. he need direct print out.

so is there any easy wat to make it direct printout.

else i need to use the same barryvdh/laravel-dompdf

Kindly guys reply and help me please.

14 Mar
1 week ago

AbdulBazith left a reply on How To Perform Calculation In Javascript With Array Of Textbox And Array Of Dropdowns

Guys some one help me please.

need the process of calculation??

12 Mar
1 week ago

AbdulBazith left a reply on How To Perform Calculation In Javascript With Array Of Textbox And Array Of Dropdowns

@lostdreamer_nl

Kindly reply please.

becoz no one is responding. sticking into the same type of problem.

what u gave worked super. but need to perform calculation also how please reply please..

11 Mar
1 week ago

AbdulBazith started a new conversation How To Perform Calculation In Javascript With Array Of Textbox And Array Of Dropdowns

Guys iam working with a project like inventory control

i had a problem with dropdown array and textbox array,

when i choose a drop down its relevant rate must be filled in the text box

the below is the coding. this worked fine


 <thead>
 <th>Product</th>
 <th>Quantity</th>
 <th>rate</th>
 <th>Action</th>
</thead>

// replace all these ID's with CLASSes because they will be duplicated
<tr>
    <td>
    <select class="product" name="product">
            @foreach($products as $product)
          <option value="{{ $product->id }}" data-rate="{{$product->rate }}">{{$product->product_name }}</option>
            @endforeach
    </select>
    </td>
    <td>
        <input type="text" class="qty" name="qty[]"   value="10" />
    </td>
    <td>
        <input type="text"  class="rate"  name="rate[]" readonly />
    </td>
    <td>
        <input type="button" class="aa"  onclick="insRow()" value="Add">
</tr>



this is my jquery

$('.product').change(function(){
    var selected = $('option:selected', this);
    // this should now output the correct product name and its rate.
    console.log(selected.attr('value'),  selected.data('rate') );

    // now to add it to rate field within this TR
    $(this).parent().parent().find('.rate').val( selected.data('rate') )
});


based on @lostdreamer_nl answer the above code worked

for this refer: https://laracasts.com/discuss/channels/laravel/how-to-fetch-rate-of-a-product-from-db-which-is-selected-in-select-box-in-array

Now whats my problem is i have more the 2 textboxex so i need to perform calculation how to do this?

whats my doubt is if text box changes then i need to perform a calculation and then the result must be displayed in next textbox how it is possible?

same in this array.

example

product         qty         rate        rate_per_kg      discount_amount     Total_amount
Rice                10          1000             100         100                             900
dal             20          400                 20          50                              350 

                         Grand Total                                     1250



this is also the same array format.

but in old doubt when product name selected the rate will be displayed

here after the rate displayed i will enter the quantity then the rate/kg must be displayed then i will enter the discount amount the total amount must be displayed.

How could i do this??

please . help please.

this the details of the texboxes.


  <td>
        <input type="text" class="rate_per_kg" name="rate_per_kg[]"  />
    </td>

 <td>
        <input type="text" class="discount_amount" name="discount_amount[]"  />
    </td>

<td>
        <input type="text" class="total_amount" name="total_amount[]"  />
    </td>



<td>
        <input type="text" class="grand_total" name="grand_total"  />
    </td>



how to do this Kindly some one help please.

08 Mar
1 week ago

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl

Kindly refer my other question also please.

the same doubt like this question.

in this question if dropd down changes text box changes.

whats my doubt is if text box changes then i need to perform a calculation and then the result must be displayed in next textbox how it is possible?

same in this array.

example

product_name        qty         rate        rate_per_kg     discount_amount     Total_amount
Rice                    10          1000    100                 100             900
Wheat               20          400     20                  50              350
                Grand Total                                                 1250





this is also the same array format.

but in old doubt when product name selected the rate will be displayed

here after the rate displayed i will enter the quantity then the rate/kg must be displayed then i will enter the discount amount the total amount must be displayed.

How could i do this??

please . help please.

this the details of the texboxes.

   <td>
        <input type="text" class="rate_per_kg" name="rate_per_kg[]"  />
    </td>

 <td>
        <input type="text" class="discount_amount" name="discount_amount[]"  />
    </td>

<td>
        <input type="text" class="total_amount" name="total_amount[]"  />
    </td>



<td>
        <input type="text" class="grand_total" name="grand_total"  />
    </td>


06 Mar
2 weeks ago

AbdulBazith left a reply on How To Fill The Text Box With Rate And Process A Calculation Laravel?

@lostdreamer_nl

sorry for once again tagging you.. Kindly reply for this question,

i think its same as the old question but has many textboxex and calculations also..

05 Mar
2 weeks ago

AbdulBazith left a reply on Button On The Same Line / Row

@ain

yes as per @maverickchan 's reply. u have a condition then only one button could be displayed. then whats the problem??

and one thing as per my understanding what u expect is need to put the button side b side.

the problem is with the css.

i think u have those in tables am i right??

so u tried to display that in the if ur td cell width is smaller then it wont be be displayed side by side.

so better to adjust it in css. like using "style=width:50%" like this

AbdulBazith left a reply on How To Post Full Coding Here Without Being Cut?

@ain

u can post ur code inbetween

this tag ``` (this is a symbol which is in the tild symbol)

say for example if i need to write a code first put this three times like this ```

and then write your code and then now once again put three times ```

like below

You can write all your codes here


and for image u can use https://imgur.com/ go to this link post your image, a link will be generated. past that here.

thats it

AbdulBazith started a new conversation How To Fill Db With Id Of A Value From Textbox Laravel

Guys i am working with a project like inventory control.

i have a purchase order with purchase order_id and supplier_id.

i am viewing it in another form. In that form the supplier name will be displayed as becoz i have given foreign key in textbox as read-only format.

say for example supplier id= 3 means. in the form its name ="Supplier3" so i have a table. in that the id only must be inserted. how it is possible?

if it is drop down means i can easily do that.

<select>
<option value={{id  of that supplier}}>name of that supplier</option>
</select>

but if text box means what can i do? how can show its name in textbox and add its id to db?? someone help please

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl thank you thank you soo much for you response.

understood.

i need to refer further about this.

and @lostdreamer_nl i had posted another question which is very related to this question.

if possible kindly reply.

Refer: https://laracasts.com/discuss/channels/laravel/how-to-fill-the-text-box-with-rate-and-process-a-calculation-laravel

AbdulBazith started a new conversation How To Fill The Text Box With Rate And Process A Calculation Laravel?

Iam working with a project.

i have a purchase order form

user fills the purchase order form with multiple products,

that worked correctly

now, i need to bill the rate for those orders,

that is, first a purchase order is done, with product_name and qunatity with supplier_name.

and it is taken as printout and given to the shop, then those products are received from the shop with a bill given from that shop

so now i need to enter the stock into stock table and Amount for that supplier in db.

so what i done is. when the purchase order is done, i had a link for that purchase_order Number.

so after the stock is received the admin clicks the link. so that the ordered product with ordered quantity will be displayed in the screen with tabulation structure. additionally i have 3 more textboxex near to each products.

as per the shop bill i will enter the total rate of that product, so after entering that the quantity must be divided with that total rate and in the next text box rate per kg must be displayed.

this is my coding,

<tbody>
    @php ($s_no = 1)

    @foreach($orderlists as $orderlist)
    <tr>
        <td>{{ $s_no }}</td>

        <td>{{ $orderlist->product->product_name }}</td>

        <td>
            <input type="text" name="product_qty[]" class="form-control product_qty" id="product_qty" required
                    value="{{ $orderlist->qty }}" />
        </td>

        <td><input type="text" name="total_price[]" class="form-control total_price" id="total_price"/></td>


        <td><input type="text" name="rate_per_kg[]" class="form-control rate_per_kg" id="rate_per_kg" /></td>

        <td><input type="text" name="name" class="form-control gst_amount" required name="gst_amount[]" id="gst_amount" /></td>

        <td> <input type="text" class="form-control total_amount" required name="total_amount[]" id="total_amount" /></td>

        <td><button class="btn btn-info" >Delete</button></td>
    </tr>

    @php ($s_no++)
    @endforeach


    <tr>
       
        <td>
            <input type="text" name="name" class="form-control overall_total" required readonly name="overall_total[]" id="overall_total" />
        </td>
       
    </tr>
</tbody>


this is the screen for that: https://imgur.com/RkCMMKF

this is the explanation for that screen

This is my form. the product and quantity are filled by the purchase order. here, thoor dhaal 20 kg , briyani rice 50 kg, refind oil 40 lts

ordered. now from the shop bill the price will be filled, automatically the price per kg must be calculated & filled then admin will enter the gst amount then the total amt is filled with adding price + GST amount. and also i have a total text box below which adds the whole amount of total Amt.

when i click add to stock, this must updated in stock table as well as the total amount must be updated to the specific supplier table.

first how to perform this calculation? it must be written in jquery or javascript only, but i dont know how becoz it is in array format.

Guys help please.

04 Mar
2 weeks ago

AbdulBazith left a reply on How To Retrive Multiple Records From One Table And Insert Into Another Table?

@johnbraun and @rdelorier thank you so much for your responses.

Both of the answers worked fine.

thank you guys.

i used the below code as per @j


public function markAllEmployeesPresent() 
{
    $employees = Employee::all();
    
    foreach ($employees as $employee) {
        Attendance::create([
            'employee_id' => $employee->id,
            'date' => Carbon::today(), 
            'atten_count' => .... ,
        ]);
    }
}


01 Mar
2 weeks ago

AbdulBazith left a reply on How To Retrive Multiple Records From One Table And Insert Into Another Table?

@rdelorier thank you so much for your response.

DB::statement("insert into attendance_table (employee_id, present) select id, 1 from employees")

do we dont need any loop for this.

becoz i have 100 employees, so in a single query for all the 100 employees it must be filled with '1'.

How it is possible please

AbdulBazith left a reply on How To Retrive Multiple Records From One Table And Insert Into Another Table?

@johnbraun thank you thank you so much for you response.

u gave me such a clear explanation.

but iam not using any relationship for date.

just have a employee table with their information such as(name, location, age, address, etc)

having attendance table eith columns(employee_id(fk), date, atten_count)

so having a button, when clicked moves to controller, then their i expect a get() query to fetch all employees_id from employee table and then a insert in attendance table with those employee_id and current_date and count(0, or 1)

thats it

i like your approach. using pivot table because this posses many to many relationship. but my application is simple. so i no need to have that relationship thats why..

sorry.

is there any easy way that i expected, like just a a fetch get() and then a insert

please

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl

i did thisin my model and it worked

 protected $fillable = ['login_user_id', 'purchase_order_id', 'product_id', 'qty'];

iam not sure this will cause any affect future..

If this is ok then ok. else give me another suggestion.

i also have a big doubt, can u explain this

$('.product').change(function(){
    var selected = $('option:selected', this);
    // this should now output the correct product name and its rate.
    console.log(selected.attr('value'),  selected.data('rate') );

    // now to add it to rate field within this TR
    $(this).parent().parent().find('.rate').val( selected.data('rate') )
});


whats hapening. now only iam hearding abt this.

basically what i will do is will use ajax to retrieve the information of specific thing.

where can i use ajax and where can i use the coding which u gave?

also if possible explain it.. else share any link i will see from that.

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl

it showing error

Illuminate \ Database \ Eloquent \ MassAssignmentException
login_user_id

so when i comment login_user_id

then the error is same moves to purchase_order_id

whats the problem, when i refer in net the solution is to use $fillbale in the model. is that right??

some says that not be security like that??

28 Feb
3 weeks ago

AbdulBazith started a new conversation How To Retrive Multiple Records From One Table And Insert Into Another Table?

guys iam working with a project.

i have employee information in separate table.

i need to put attendance for those employees.

i can put daily attendance for all so what i decided is just i have button if click that

all employee id is fetched from employee table and filled with '1' as present in attendance_table.

only a few will be absent , so after all present i will edit for that specific person,

whats my doubt is how i can fetch all employee id from one table and insert into another table.. that is multiple insertion . many rows so how??

this is my model Employee this is my controller Employee

my employees table contains emp_id, emp_name etc.

now i need to fetch it and store in my attendaces table

this table contains the fields emp_id, atten_day

this is my model EmpAttendance and this is my controller EmpAttendance

how to do this??

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl i got it

what i did is


 $purchaseorders->save();

        $last_id = $purchaseorders->id;

 $data = $request->all();
        $rows = [];
        foreach($data['product_name'] as $i => $name) {
    
            $rows[] = [
                'login_user_id'=>auth()->id(),
                'purchase_order_id'=>$last_id,
                'product_id' => $name,
                'qty' => $data['qty'][$i],
                // 'product_rate' => $data['rate'][$i],
            ];
        }
       
        dd($rows);

so that what i expect i got it. after saving the purchase_order_list just i picked the last id using $last_id = $purchaseorders->id; this

and the the login id also i gave it auth()->id().

now atlast how to insert it into the order_list table

that is $rows has the array i expect. how to insert it in the table

as i mentione like this


$orderlists=new OrderList;

orderlists->$rows->save();

or some other??

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl thank you for you response.

ya i can get the $row in dd(). it is in the format what i expected.

but i need the purchase_order_id also.

the purchase_order_id, order_date, order_time etc will be inserted into purchase_order_list table.

after that insertion the id from that inserted row is taken for the order_list..

see


$purchaseorders=new PurchaseOrder;
$orderlists=new OrderList;

$purchaseorders->login_user_id =auth()->id();
$purchaseorders->pur_order_num=trim($request->pur_order_num);
$purchaseorders->supplier_id=trim($request->supplier_id);
$purchaseorders->odate = trim($request->odate);
$purchaseorders->otime = trim($request->otime);
$purchaseorders->edate = trim($request->edate);
$purchaseorders->etime = trim($request->etime);

$purchaseorders->save();

here the data is saved in purchase order

now the id from this table is used as foreign key in the order_list table

that is as per your coding


public function save( Request $request) 
{
    $data = $request->all();
    $rows = [];
    foreach($data['product_name'] as $i => $name) {
    // this is where you loop over the products array and grab the data from name / qty and rate arrays
        $rows[] = [

    'purchase_order_id'=>'????????' // here how can i get the purchase order id from that table. 
            'product_name' => $name,
            'product_qty' => $data['qty'][$i],
            'product_rate' => $data['rate'][$i],
        ];
    }
    // $rows is now in a format you can use on your table.
    dd($rows);

as per my guess i need to write a get() query for that id (last entered id) from that table(purchase_order_list) and to use here am i right???

and another doubt??

after $rows how can i insert it into my order_list table??

whether like this

$orderlists=new OrderList;

orderlists->$rows->save();

How can i do that???

i will say it clearly,, when the form is sumbitted the purchase_number, order_date, order_time, expected date, expected time, supplier name all this will be stored in purchase_order_list table.

and the the id of the purchase_order_list table is taken and then that id, the product_name, qty,rate all these will be filled in the order-list table

this is the representation of order_list table


login_user_id           purchase_order_id           product_id          qty

1                   1                               1               20
1                   1                               2               30      
1                   1                               3               10




where purchase_order_id is from table purchase_order_list , and product_id is from table products and login_user_id is auth()->id();



the above four must be come in this place


 $rows[] = [
        'login_user_id'=>????????
        'purchase_order_id'=>??????
            'product_name' => $name,
            'product_qty' => $data['qty'][$i],
            'product_rate' => $data['rate'][$i],
        ];

the question mark to be filled. thats the problem??

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@munazzil thank you thank you for you response.

let me try ur code and will respond

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl thank you sooo much.. it worked well, but for the duplication of row its not working.

only for the first row it worked i made a small change, that

changed $('.product_name').change(function(){

to

$(document).on("change", ".product_name", function() {

everthing fine, now how can insert these bulk data into db.

i have two tables

purchase_order_list that has fields

id(pk)
login_user_id(fk)
pur_order_num
supplier_id(fk)
order_date
order_time
expec_date     //expected date
expec_time     //expected time
del_date      //delivery date
del_time       //delivery time

order_list that has fields

id(pk)
login_user_id(fk)
purchase_order_id(fk)    //takes id from the above table purchase_order_list
product_id(fk)     //takes from product table
qty

how could i store these inside my db.

my models PurchaseOrder and OrderList

and in my store method i have like this,

public function store(Request $request) { $purchaseorders=new PurchaseOrder; $orderlists=new OrderList;

$purchaseorders->login_user_id =auth()->id(); $purchaseorders->pur_order_num=trim($request->pur_order_num); $purchaseorders->supplier_id=trim($request->supplier_id); $purchaseorders->odate = trim($request->odate); $purchaseorders->otime = trim($request->otime); $purchaseorders->edate = trim($request->edate); $purchaseorders->etime = trim($request->etime);

$purchaseorders->save();


for the above coding there will be no problem becoz just only one row is goingto be inserted that will work 
fine
but after that i have three things  ```purchase_order_id,product_id,qty```

after the ```$purchaseorders->save();``` i need to write coding for saving the order_list


$orderlists->purchase_order_id= ($request->purchase_order_id); $orderlists->product_id = ($request->product_id ); $orderlists->qty = ($request->qty );

these three are arrays, so how can i insert these in my table?? the ```purchase_order_id`` will be repeated and product_id will have many products with qty..

How to insert this?? Kindly suggest please

27 Feb
3 weeks ago

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl thank you thank you so much for your response.

"Any more questions, just tag me again ;)" thank you for these lines.

Let me explain my question clearly.

basically if we have a dropdown with data inside it like Rice, wheat, etc.

when i select rice in the drop down. the textbox must be autofilled with its rate 50 rupees

this is possible by ajax.

just i will pick the data from the dropdown using its id and move to controller search there and the result is filled in the text box with texbox id

all this will be done using ajax

Am i right??

like this


<select id="product" name="product">
  <option value="rice">rice</option>
  <option value="wheat">wheat</option>  
</select>

what's my problem is,

i have a purchase for in tabulation structure..

<thead>
 <th>Product</th>
 <th>Quantity</th>
 <th>rate</th>
 <th>Action</th>
</thead>

<tr>

    <td>
        <select  id="product_name"  name="product_name[]">
            @foreach($products as $product)
            <option value='{{ $product->id }}'>{{$product->product_name }}</option>
            @endforeach
        </select>
    </td>
    <td>
        <input type="text" id="qty" name="qty[]"   value="10" />
    </td>
    <td>
        <input type="text"  id="rate"  name="rate[]" readonly />
    </td>
    <td>
        <input type="button" id="aa"  onclick="insRow()" value="Add">
</tr>

this is the screen for that

Refer: https://imgur.com/a/2aEQnmy

In the product drop down if user selects the product name, automatically its rate must be filled in the rate column.

And admin may purchase more products. so i have a add button when admin clicks that further rows are inserted.

Refer this image: https://imgur.com/a/bSsbvQx

Here when add button is clicked new rows are inserted. so when admin changes the drop down its relevant rate must be filled in the correct rate column. how this is possible in ajax??

normally if i have one drop down means i will do this by picking the data with its id. here what should i do?

and this is my coding to make the rows duplicate

function insRow() {

        var table = document.getElementById('purchase_table');
        var rowCount = table.rows.length;

        var row = table.insertRow(rowCount);
        var colCount = table.rows[1].cells.length;
        for (var i = 0; i < colCount; i++) {
            var newcell = row.insertCell(i);
            newcell.innerHTML = table.rows[1].cells[i].innerHTML;
        }
    }


refer this image: https://imgur.com/a/wv8WZzc

when there is only one row. the console looks like this.

Refer this image: https://imgur.com/a/25v1wRv

Here i clicked the add and a new is created.

now when i change the first row drop down product, its rate must be auto filled in the first row rate column ,

and when i change the second dropdown product its rate must be autofilled in the secodn row rate column

like this goes on.

admin can order many products.

How this is possible,

i think i explained it clearly.

if any mistakes sorry,

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@vnvdv91 thank you thank you for your response.

sorry for the delay.. busy with other work.

let try now and intimate u fastly.

23 Feb
3 weeks ago

AbdulBazith left a reply on How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

@lostdreamer_nl

sorry for tagging you, but no one responding. i think in my validation thread you helped me more.

thats y i tagged you kindly help please.

22 Feb
3 weeks ago
21 Feb
1 month ago

AbdulBazith started a new conversation How To Fetch Rate Of A Product From Db Which Is Selected In Select Box In Array

Guys iam working with a project inventory control

i have a purchase order form which is table structure product name(select box), quantity(textbox) and rate(textbox with readonly)

i have a add button also when admin clicks it a new row with another select box, quantity and rate is raised. it is done using javascript

i have given array for all these three,

this is form blade file


 <thead>
 <th>Product</th>
 <th>Quantity</th>
 <th>rate</th>
 <th>Action</th>
</thead>

<tr>

    <td>
        <select id="product_name" name="product_name[]">
            @foreach($products as $product)
            <option value='{{ $product->id }}'>{{$product->product_name }}</option>
            @endforeach
        </select>
    </td>
    <td>
        <input type="text" name="qty[]" id="qty"  value="10" />
    </td>
    <td>
        <input type="text" name="rate[]" id="rate"  readonly />
    </td>
    <td>
        <input type="button" id="aa"  onclick="insRow()" value="Add">
</tr>

and this is my javascript

function insRow() {

        var table = document.getElementById('purchase_table');
        var rowCount = table.rows.length;

        var row = table.insertRow(rowCount);
        var colCount = table.rows[1].cells.length;
        for (var i = 0; i < colCount; i++) {
            var newcell = row.insertCell(i);
            newcell.innerHTML = table.rows[1].cells[i].innerHTML;
        }
    }

Everything works fine, but what the doubt is all the names are in arrays,

product_name[], qty[], rate[]

if admin select a product name in that select box say for example "Rice" then in the rate select box the rate of that product must be come.

i know this could be done using Ajax only.

whats the problem is if there is one select box and one text box , i will use ajax and if that select box changes based on that the rate will be fit to text box. with names i do this.

But here it is array, so how can i match with product item to rate from db using ajax.

Another doubt,

after fetching this how can i save it into db ??

that is my purchase table contain

product_name, 
product_qty, 
product_rate

so from the from admin may send 10 product name with 10 product qty with 10 product rate.

so in my table it must be inserted as 10 rows , how can i do this??

Kindly please answer..

iam struggling

Please suggest your answers

AbdulBazith left a reply on How To Make Dynamic Insertion Of Textbox In Table With Dynamic Rows

@techguru thank you thank you so much for your response.

i referred that and i got answer from this

https://viralpatel.net/blogs/dynamically-add-remove-rows-in-html-table-using-javascript/

and thank you for your response

19 Feb
1 month ago

AbdulBazith started a new conversation Design Scrambles When Page Loading Usually And Also Page Load Slow

Guys iam working with a project an Inventory like project.

when running laravel application the deisgn scrambles by missing the textboxex or placing somewhere else in the screen like that. after one time refresh it load correctly.

But i face the problem usaually. when i first time load the page it scrambles and next reload it works fine.

what may be the reason. i faced the same problem in my last 2 projects also. i understood that mistake is mine but i can get it.

this is what the procedure i follow i have a main.blade file

<!DOCTYPE html>
<html lang="en">
    <head>
        @include('partials._head')
    </head>
    <body >
        @include('partials._navbar')
        @include('partials._messages')
            @yield('content')
             @include('partials._footer')
        @include('partials._javascript')
    </body>
</html>


here the _head contains the header tag of the html like title any css files included

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>SRP @yield('title')</title>
<script src="{{asset('js/sweetalert.min.js')}}"></script>

<link href=" {{ URL::asset('css/style.default.css') }}" rel="stylesheet">

<link href=" {{ URL::asset('css/morris.css') }}" rel="stylesheet">

<link href=" {{ URL::asset('css/select2.css') }}" rel="stylesheet">

<link href=" {{ URL::asset('css/bootstrap-timepicker.min.css') }}" rel="stylesheet">

the _navbar contains the nav bar of the application

<head>
head section include in this
</head>

the _message contains the error message to be shown in the screen

Error messages

content is the page of the center body portion of that page

_footer contains the copyrights etc texts.

_javascript file contains the necessary js files

<script src="{{asset('js/jquery-1.11.1.min.js')}}"></script>

<script src="{{asset('js/jquery-migrate-1.2.1.min.js')}}"></script>

<script src="{{asset('js/jquery-ui-1.10.3.min.js')}}"></script>

<script src="{{asset('js/bootstrap.min.js')}}"></script>

<script src="{{asset('js/modernizr.min.js')}}"></script>

<script src="{{asset('js/pace.min.js')}}"></script>

<script src="{{asset('js/retina.min.js')}}"></script>

<script src="{{asset('js/jquery.cookies.js')}}"></script>

<script src="{{asset('js/select2.min.js')}}"></script>

<script src="{{asset('js/jquery.validate.min.js')}}"></script>

<script src="{{asset('js/custom.js')}}"></script>

<script src="{{asset('js/flot/jquery.flot.min.js')}}"></script>

<script src="{{asset('js/flot/jquery.flot.resize.min.js')}}"></script>

<script src="{{asset('js/flot/jquery.flot.spline.min.js')}}"></script>

<script src="{{asset('js/jquery.sparkline.min.js')}}"></script>

<script src="{{asset('js/morris.min.js')}}"></script>

<script src="{{asset('js/raphael-2.1.0.min.js')}}"></script>

<script src="{{asset('js/bootstrap-wizard.min.js')}}"></script>

<script src="{{asset('js/dashboard.js')}}"></script>

<script src="{{asset('js/bootstrap-timepicker.min.js')}}"></script>

<script src="{{asset('js/jquery.validate.min.js')}}"></script>

why this hapens

is my flow right?? else anything wrong.

and the application is slow also.

for even 50 records application is slow. after hosting means there will lots of records so there will be too much slow.

is there any solution?? do i need to add something? or do i need to remove something?

and these are my route file


Route::get('/', function () {
    return view('Authentication.register');
});

Route::get('/LoginForm', function () {
    return view('Authentication.login');
});

Route::get('/add-product-type', function () {
    return view('Products.add-product-type');
});


//Authentication Process Start

//Register
Route::resource('RegisterLogin','AuthenticationController');

//Login
Route::post('Login','[email protected]')->name('login');

//Logout
Route::get('logout','[email protected]')->name('logout');

//Authentication Process End



//Start of Products
Route::resource('Product_type','Product_typeController');
Route::resource('Product','ProductController');
//End of products

//Start of Supplier
Route::resource('Supplier','SupplierController');
//End of Supplier


//Start of Purchase Order List
Route::resource('PurchaseOrderList','PurchaseOrderListController');
//End of Purchase Order List


the same rule only i followed in my old tow project also.

how can i solve this?

AbdulBazith started a new conversation How To Make Dynamic Insertion Of Textbox In Table With Dynamic Rows

Guys iam working with a project for an hotel

It contains purchase order form

the admin chooses the supplier, and order_date and order_time. purchase order ID will be generated by default.

what the doubt is after choosing all this admin need to list the order. i have give it in table structure with columns

Product_name and quantity.

like


<table class="table table-bordered mb30" id="purchase_table" name="purchase_table">
    <thead>
        <tr>

            <th>Product</th>
            <th>Quantity</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        <tr>

            <td> <select id="purchase_items" name="purchase_items" data-placeholder="Choose One" class="width100p" required>
                    <option value="Rice">Rice</option>
                    <option value="Wheat">Wheat</option>

                </select></div>

            </td>
            <td> <input type="number" name="quantity" id="quantity" class="form-control" />

            </td>

            <td><button class="btn btn-info">Add</button>
                <button class="btn btn-info">Delete</button></td>
        </tr>

    </tbody>
</table>

i have kept one select box(list the products) in product and one text box in quantity. in the action i kept 2 buttons Add and Delete.

Whats my doubt is there may be lots of product to order. so user just chooses the product from slelect box and enters the quantity. if he needs to add another item then if he clicks the add button another row inserted with another selectbox and text box with different names, so only i can insert it into db. if admin clicks the delete the row must be deleted.

how cuold this be possible?? please some one help?

Another doubt after getting this information how can i insert into db

say for example if new rows are created by clicking the ad button the when clicks save it moves to store method in controller, there how could i store it in the db??

this is my pruchase table with two fileds product, and quantity. in this how could i store all the data comes from form??

Kindly some one help please please.

Suggest your ideas.

I know that adding new row is possible in javascript. i tired but the problem is the name of that text box and select box.. it must also change.

AbdulBazith left a reply on How To Make Address Bar With File Name In Laravel

@cronix thank you thank for your response.

actually my expectation is not to use .tml extension in file name,

but iam expecting to get rid of the function name in the url like ```create`` like that.

and anther thing if i edit a data that data id is showed in the address bar.

instead of that i need to display only the editable file name..

we can say this thread as an example

see the url

https://laracasts.com/discuss/channels/laravel/how-to-make-address-bar-with-file-name-in-laravel


the domain name/folder name/my question title

like this just the domain name and folder name and file name to be displayed.

no the function names in the controller. how to do this??

18 Feb
1 month ago

AbdulBazith started a new conversation How To Make Address Bar With File Name In Laravel

Guys iam working with new project.

Its a software for accounts management.

In laravel the function name of the controller is displayed in the address bar

why?

how can i change that into file name like html

say for example

i have files

purchase_order.html

list_order.html

and so onn

if i make this as blade template

in my controller i used create method to display the pruchase order_form

it shows the

http://localhost:8000/create

else 

if it shows the controller name


how can i use that file name as url

when i reffered i got that slugs are used for that.

for just displaying the url i need to work a lot. i need to create a table??

and if view a specifc record its number is displayed in the url.

what i expect is just the project directory and the file name as url how i can do this??

Kindly some one help please..

in my old project its just running in local machine so i not used that, but in this project it should be hosted..

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

@ryanpurcella thank you thank you for your response.

and sorry for the very late delay. somewhat busy in another project ..

i will try it and i will intimate.

once again thank you for response.

06 Feb
1 month ago

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

@douglasakula iam using xampp server

ya i found that.

it contains lots of things. in that what should i do??

AbdulBazith started a new conversation Guys Having Doubt In Dynamic Creation Of Rows In Table

Guys iam working with a new project for a hotel.

Its like inventory control.

The hotel needs to purchase products(like wheat, rice, vegtables spices etc.) from outside suppliers.. and maintain the stock.

i have a purchase form.

but whats my problem is from one supplier many products can be bought.

so i made a form to choose date, supplier. and below that i have a table structure in which

i have product name, price, quantity, total and a add button, delete button.

so when user clicks add button a new row must raise in that secodn product is entered ,tis quantity entered. like that goes on.

at last there must be a sub total.

this is my table

  <table class="table">
                                            <thead class="thead-dark">
                                                <tr>
                                                    <th scope="col">Sno</th>
                                                    <th scope="col">Product</th>
                                                    <th scope="col">Quantity</th>
                                                    <th scope="col">Price</th>
                                                    <th scope="col">Total</th>
                                                    <th scope="col">Action</th>
                                                </tr>
                                            </thead>
                                            <tbody>
<tr>
                                                    <td>1</td>
                                                    <td><select class="form-control">
                                                            <option>Wheat</option>
                                                            <option>Rice</option>
                                                        </select></td>
                                                    <td><input type="text" class="form-control" id="exampleInputName1"
                                                            placeholder="Name"></td>
                                                    <td><input type="text" class="form-control" id="exampleInputName1"
                                                            placeholder="Name"></td>
                                                    <td><input type="text" class="form-control" id="exampleInputName1"
                                                            placeholder="Name"></td>
                                                    <td><button type="button" class="btn btn-icons btn-rounded btn-success">
                                                            <i class="fa fa-plus" aria-hidden="true"></td>
                                                </tr>




tthink that my add mutton id is id=add and name=add and my table id is id=pur_table name=pur_table

so what should i do??

Kindly some one help

When i click tha ad button new row must raise like that goes on and for each one name must also change so that only i can insert into db

Kindly suggest your ideas and if possible please share a link.

i referred in net all the videos are showing the project only not the concept what i expect.

is my apporach is right? else i need to change the process.. i think all the inventory control follow this process only for purchase.

please help

05 Feb
1 month ago

AbdulBazith left a reply on Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

@douglasakula thank you for your response

actually the application is not hosted in server. it just running in local machine.

if less records is given the pdf is downloaded. but if large data date is given then the browser is loading loading keep on loading.

nothing hapens.

AbdulBazith started a new conversation Barryvdh/laravel-dompdf Not Downloading For Large Amount Of Records. Its Just Loading

Guys i have a small correction in my old project "milkfarm"

i used barryvdh/laravel-dompdf to take report of my purchase, sales tables.

whats the proble is i have a nav bar daybook when i click that it asks user to enter the date. andafter thedate is entered the whole transaction of that date will be downloaded as pdf report

here whats the problem is if there is large record then the page is loading loading, but not downloading..

i checked for another date also. if i give today date it is downloaded, because today there are less records.

ig i give yesterday date it also downloaded, but on 3rd of february i have lots of records so its not downloading

whats the problem.

this is my daybook controller

 $purchase_details = Purchase_details::whereDate('date',$request->search_date)->get();

    $sales = Sales_details::whereDate('date', $request->search_date)->get();

    $selss = Self_stock::whereDate('date',$request->search_date)->get();

    $exs = Excess_milk::whereDate('date', $request->search_date)->get();

    $pays = Pay::whereDate('date', $request->search_date)->get();

    $overallstock = Overallstock::whereDate('date',$request->search_date)->get();

    $receives = Receive::whereDate('date', $request->search_date)->get();

    $paid_details = Paid_details::whereDate('updated_at', today())->get();

    $received_details = Received_details::whereDate('updated_at', today())->get();

    $p_accounts = Personal_account::whereDate('date', $request->search_date)->get();

 $pdf=PDF::loadView('DayBook.daybookpdf', [
        'purs' => $purchase_details,
        'total_amount1'=>$purchase_details->sum('total'),
        'total_litre'=>$purchase_details->sum('no_of_litre'),

        'sales' => $sales,
        'total1' => $sales->sum('total'),
        'no_of_litre1' => $sales->sum('no_of_litre'),

        'sels' => $selss,
        'no_of_litre_tot'=>$selss->sum('no_of_litre'),

        'exs' => $exs,
        'no_of_litre_tot' => $exs->sum('no_of_litre'),

        'pays' => $pays,
        'total_amount2'=>$pays->sum('amount'),

        'overalls' => $overallstock,
        'total_purchase'=>$overallstock->sum('purchased_milk'),
        'total_self'=>$overallstock->sum('self_milk'),
        'total_milk'=>$overallstock->sum('total_milk'),
        'total_sold'=>$overallstock->sum('sold_milk'),
        'total_excess'=>$overallstock->sum('excess_milk'),
        'total_balance_milk'=>$overallstock->sum('balance_milk'),

        'receives' => $receives,
        'total_amount3'=>$receives->sum('amount'),

        'paids' => $paid_details,
        'total_total_amount_amount'=>$paid_details->sum('total_amount'),
        'total_paid_amount'=>$paid_details->sum('paid'),
        'total_balance_amount'=>$paid_details->sum('balance_amount'),
        'total_personal'=>$paid_details->sum('personal_amount'),

        'received_details' => $received_details,
        'total_total_amount'=>$received_details->sum('total_amount'),
        'total_paid'=>$received_details->sum('paid'),
        'total_balance'=>$received_details->sum('balance_amount'),

        'p_accounts' => $p_accounts,
        'total_amount4'=>$p_accounts->sum('amount'),
        'date'=>$request->search_date

    ]);
  
    $pdf->setPaper('A4','landscape');
    return $pdf->download('Day Book.pdf');


what i did in the above coding isjust retrieved records from all tables and send it to the pdf file.

Kindly some one help please to rectify my problem.

02 Feb
1 month ago

AbdulBazith left a reply on How To Convert Laravel Web Application Into Mobile Application

@siangboon sorry for the delay. and thank you so much for your response.

Let me refer it..