Niyaz

Niyaz

Member Since 1 Year Ago

Software Engineer at united Arab Emirates

Experience Points 520
Experience Level 1

4,480 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 1
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.

19 Jul
1 year ago

Niyaz started a new conversation Upload A Csv File And , Store And Retrieve It Into The View Page

Hi can anyone help me to import CSV file into the database and retrieve it and show the content into a view and also generate a pdf format of that view blade I have created the form for it.

28 Jun
1 year ago

Niyaz left a reply on To Send Multiple PDF Attachment In Single Mail

Hey Thanks for your help And i have found the mistake done by me and rectified it It is just the mistake of file extension.

Niyaz left a reply on To Send Multiple PDF Attachment In Single Mail

Well. everything is working fine but im not getting the file as pdf file it shows some content in pdf file as

%PDF-1.3 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [6 0 R /Count 1 /Resources << /ProcSet 4 0 R /Font <<  /F1 8 0 R /F2 9 0 R /F3 10 0 R /XObject <<  /I1 11 0 R /I2 13 0 R /MediaBox [0.000 0.000 595.280 841.890] endobj 4 0 obj [/PDF /Text /ImageC ] endobj 5 0 obj /Producer ( /CreationDate (D:20171008171519+04'00') /ModDate 

i guess i have probelm with "mime" this is my code

$pdf = PDF::loadView('pdf.request', ['request' => $data]);
            $sendData = array(
                'data'  => $data
                );
            $response = Mail::send('emails.appro_email_template', $sendData, function ($message) use ($pdf, $sendData) {
                $message->from($sendData['data']->email, $sendData['data']->name);
                $message->to($sendData['data']->email, $sendData['data']->name);
                $message->subject('form approval');
$file = public_path('assets/img/form.pdf');
                $message->attachData($pdf->output(), $sendData['data']->unit_no."_request.pdf");
$message->attach($file, array ( 'as' => 'My-second.php',
                     'mime' => $file->getMimeType() ) 
                    );
            });

also tired

'mime' => 'application/pdf')

and how can i convert the raw data into a pdf format as attachments kindly provide me a solution

Thank you

27 Jun
1 year ago

Niyaz left a reply on To Send Multiple PDF Attachment In Single Mail

Hy i tried as you said Everything works fine but the pdf is not loaded

cannot be loaded

this is my code

$pdf = PDF::loadView('pdf.request', ['request' => $data]);
            $sendData = array(
                'data'  => $data
                );
            $response = Mail::send('emails.appro_email_template', $sendData, function ($message) use ($pdf, $sendData) {
                $message->from($sendData['data']->email, $sendData['data']->name);
                $message->to($sendData['data']->email, $sendData['data']->name);
                $message->subject('form approval');
                $message->attachData($pdf->output(), $sendData['data']->unit_no."_request.pdf");
$message->attachData('http://localhost/form/public/assets/img/form.pdf',"mysecond.pdf");
            });

do i have do anything to get the original extension of file

Niyaz left a reply on To Send Multiple PDF Attachment In Single Mail

my first file is in

resources
 -- views
  -- pdf
   -- request.blade.php

and second file is in

resources
  -- img
  --  comsume.pdf

i can get 1st file in pdf as attachment in my mail function and how to get the 2nd file to along with 1st in the mail (i.e) 2 attachment in pdf format

Suggest me an idea

26 Jun
1 year ago

Niyaz started a new conversation To Send Multiple PDF Attachment In Single Mail

Hi previously I have been doing adding single attachment in an email but now i need to do it as multiple Pdf attachments in a single mail

This is my code

$pdf = PDF::loadView('pdf.request', ['request' => $data]);
            $sendData = array(
                'data'  => $data
                );
            $response = Mail::send('emails.appro_email_template', $sendData, function ($message) use ($pdf, $sendData) {
                $message->from($sendData['data']->email, $sendData['data']->name);
                $message->to($sendData['data']->email, $sendData['data']->name);
                $message->subject('form approval');
                $message->attachData($pdf->output(), $sendData['data']->unit_no."_request.pdf");
            });

can anyone tell me do it for multiple attachment Suggest me as i can use for loop or the something else, if so please guide me

24 Jun
1 year ago

Niyaz started a new conversation To Get The Values Of Dropdown Option From Database And Display It In My Blade Template

I am doing a form using laravel I already have a function to get the data from the database but now I need to display a sentence by the 2nd dropdown

This is my 1st dropdown select option

 <div class="form-group">
                            {{ Form::select('community_id',[ '1' => 'prop1', '2' => 'prop2', '3' => 'prop3' , '4' => 'prop4'], null, ['class' => 'form-control' , 'onchange' => 'prop(this.value);', 'id' => 'community-select-dropdown' ]) }}

and my 2nd drop down is the data that is from my database

like if I select "prop1" from 1st dropdown I get the values(name) from the database that is to only for "prop1"

This is my jquery function to fetch and display the name on 2nd dropdown

function prop(value)
    {
        var model = $('#building-no-block');
        organizationAction(value);
        agree();
        if (value == 1 || value == 6) {
            $.get('http://localhost/workpermit/api/get-buildings/'+value, function(data) {  
                model.empty();
                    var option = '';
                    $.each(data.result, function(index, element) {
                    option +="<option value='"+ element.room_name +"'>" + element.room_name + "</option>";
                })
                    console.log(option);
                    model.append('<select id="building-select-dropdown" name="building_no" class="form-control"><option>Select Building</option>'+option+'</select>');
                   
                    
            });
            } else {
                    model.empty();
                    model.append('<input type="text" name="building_no" class = "form-control" placeholder = "Building No">');
                }

    }

And my query is to display a sentence as a div id in my blade template as " A deposit of (room_name) is necessary" so whenever i click different room_name from my 2nd dropdown that has to be changed in a "deposit of (room_name) is necessary" too

Can anyone help me to find the better solution for it even by laravel controller or by jquery

21 Jun
1 year ago

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

I tried this

$('input[name="community_id"],input[name="category_of_works"]').change(function () { 
    var community = $('input[name="community_id"]').val();
    var category = $('input[name="category_of_works"]').val();
    var secdepo ;

    if (community == 2 && category == 0) {
             secdepo ='<li>A refundable security deposit of AED 500.00 </li>'
      } else {
        secdepo = '<li>A refundable security deposit of AED 5,000.00 </li>'
       }
        $('#secdepo').empty().append(secdepo);
});

and in my blade

<label class="col-xs-3 control-label">Terms and Conditions</label> 
                            <div class="col-xs-9">
                                <div class="agree-terms">  
<ul>
<div id="secdepo"></div>
<li>I understand xxxxxxxxxxxxxx.</li>
                                        <li>I confirm that xxxxxxxxxxxxxxxxxxxxxx</li>
                                        <li>I confirm that xxxxxxxxxxxxxx.</li>
 </ul>
                                </div>
                            </div>

but still didn't get it

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

Tried but didn't get the line in terms and condition

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

Also console.log will help me whether it is running or not please tell me how to do that to?

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

Yes, there is no error But i don't find any changed in my agree-terms (class) I changed some of the code as per my wish as

jQuery('input[name="community_id",input[name="category_of_works"]').change(function(){
 
var $community = jQuery('input[name="community_id"]');
var $category = jQuery('input[name="category_of_works"]');
var $secdepo = jQuery('#sec-depo')

if($community.val() == 2 && $category.val() == 0) {
  if(secdepo.length == 0){
    jQuery('.agree-terms ul').append('<li id="sec-depo">A refundable security deposit of AED 500.00.</li>')
  } 
} else {
   $('.agree-terms ul').append('<li id="sec-depo">A refundable security deposit of AED 5,000.00 .</li>')
}
});

I used id instead of class Is there any error

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

Hi

I am getting an error after trying the code on my console as

jquery is not defined

i tried in many ways to solve it but cannot find the solution

20 Jun
1 year ago

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

Sorry since i'm new to php. I'm asking a hell lots of questions to you? Hope i will get used to php

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

Also i can clearly understand your code But cannot understand this

if ($hugeDepo.length == 0) {

where does the "length" comes from

Niyaz left a reply on How To Implement Different Condition For Different Dropdown In Form

@yorki Thank you for your reply .. :)

I have three doubt :

  1. should i have to put it into a function and trigger as onchange or as simply like your code
  2. can i use "$" instead of "jquery" , because i used it perviousely
  3. will this code will effect my previous code since i have used it as a separate code and trigger by onchange function in my select option

Please give me a better idea

Niyaz started a new conversation How To Implement Different Condition For Different Dropdown In Form

Hi, i am doing a project in laravel which i need implement different condition for different dropdown (select option) Like , this is my 1st dropdown list option

{{ Form::select('category_of_works', ['0' => 'Minor Works', '1' => 'Major Works'], null , ['class' => 'form_control'])  }}

and this is my 2nd dropdown list option

{{ Form::select('community_id',[ '1' => 'Project1', '2' => 'Project2', '3' => 'Project3' , '4' => 'Project4'],null ,['class' => 'form-control'] ) }}

My query is if i select "minor works" from 1st dropdown and "Project2" from 2nd dropdown i have to get a sentence like "Your deposit is huge" in my terms and condition

And my Terms and condition is

<label class="col-xs-3 control-label">Terms and Conditions</label> 
                            <div class="col-xs-9">
                                <div class="agree-terms">  
<ul>
<li>I understand xxxxxxxxxxxxxx.</li>
                                        <li>I confirm that xxxxxxxxxxxxxxxxxxxxxx</li>
                                        <li>I confirm that xxxxxxxxxxxxxx.</li>
 </ul>
                                </div>
                            </div>

Perviously, i have similar condition for one dropdown and i did it by javascript and query . But now i have it for 2 dropdown and i dont know how to proceed it.

Can anyone help me to solve it as i can do it by query or by laravel( php) ?

18 Jun
1 year ago

Niyaz left a reply on To Retrieve The Array Value From Database To My View Blade

@mvd

Thank you very much for your help All my requriements is working

Niyaz left a reply on To Retrieve The Array Value From Database To My View Blade

Yes @mvd ,

i did as per your code used switch, case, breaks in every line

Niyaz left a reply on To Retrieve The Array Value From Database To My View Blade

Hi

I tried using the controller

$statusInfo = array(
            1 => 'Re-activation',
            2 => 'Re-activation, Additional access',
            3 => 'Re-activation, Additional access, Lost',
            4 => 'Re-activation, Additional access, Lost, Damaged',
            5 => 'Re-activation, Additional Access, Lost, Damaged, Replacement'
         );

and on my blade


@foreach( $request->request_status as $status)
               @if (isset($statusInfo[$status]))
               {{ $statusInfo[$status] }}
             @else
               None of them is selected
            @endif
            @endforeach 

But my output is

Reason For Request:
 None of them is selected None of them is selected None of them is selected

It displays 3 times "None of them selected" instead of values

And this is my database table and their column is

  id            Name                      request_status

  1              niyaz                        ["1","2","3"]

Have to retrieve the values of "request_status"(column) into my blade template in the name as mention above.

And last but not the least , those values("1,2,3") are my checkbox value

Niyaz left a reply on To Retrieve The Array Value From Database To My View Blade

Hi @mvd ,

I tried your code of using switch in my blade And got the output as :

 Reason For Request :
 @switch ($status) @case(5) Re-activation, Additional Access, Lost, Damaged, Replacement

Instead of only displaying Reactivation,Additional Access, Lost, Damaged, Replacement

Niyaz left a reply on To Retrieve The Array Value From Database To My View Blade

Hi @mvd ,

I tried your code of using switch in my blade And got the output as :

''' Reason For Request : @switch ($status) @case(5) Re-activation, Additional Access, Lost, Damaged, Replacement

''' Instead of only displaying Reactivation,Additional Access, Lost, Damaged, Replacement

Niyaz left a reply on To Retrieve The Array Value From Database To My View Blade

Thank you for the replies since i'm new to laravel .And i have an another query like can i have if condition to print different item

Here is my code

Reason For Request @foreach( $request->request_status as $status) @if ($status == 1 && $status == 2 && $status == 3 && $status == 4 && $status == 5) Re-activation, Additional Access, Lost, Damaged, Replacement @elseif ($status == 1 && $status == 2 && $status == 3 && $status == 4) Re-activation, Additional access, Lost, Damaged @elseif ($status == 1 && $status == 2 && $status == 3) Re-activation, Additional access, Lost @elseif ($status == 1 && $status == 2) Re-activation, Additional access @elseif ($status == 1) Re-activation @else None of them is selected @endif @endforeach Please re-correct and provide me a better solution Thank you
14 Jun
1 year ago

Niyaz started a new conversation To Retrieve The Array Value From Database To My View Blade

array:13 [▼ "_token" => "K5eGLUL5zZDaemAKZljf2FuA44Qxb1oA8yqnxbWX" "community_id" => "1" "name" => "nias" "building_no" => "54" "unit_no" => "" "mobile" => "984" "email" => "" "request_status" => array:4 [▼ 0 => "1" 1 => "2" 2 => "3" 3 => "4" ] "vehicle_one" => "" "registration_one" => "" "vehicle_two" => "" "registration_two" => "" "agree" => "agree" ]

Here is my input from my form and I need to get the values of the array in the name "request_status" from the database to my view blade how to get it? anyone knows about it