nionta

nionta

Member Since 8 Months Ago

Khulna,Bangladesh

Experience Points 1,250
Experience Level 1

3,750 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 0
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.

16 Apr
6 days ago

nionta started a new conversation Get Difference Between Two Date Type Column In A Query

I want to find return a query like

    return $query->whereRaw('DATEDIFF(day,infos.date_of_enrollment, date("Y-    m-d"))','>',$svc_length_in_days);

exactly what should be the query in eloquent?

nionta left a reply on Like Search Is Not Working Properly In Eloquent

yeah I have found the problem, thanks to all

nionta left a reply on Like Search Is Not Working Properly In Eloquent

@KIMG - I have tried both before, but none of them works

15 Apr
1 week ago

nionta started a new conversation Like Search Is Not Working Properly In Eloquent

here is my query:

    ->when(!empty($name), function($query) use ($name){
                return $query->where('infos.name', 'like', $name.'%')
                    ->orWhere('infos.name', 'like', '% '.$name.'%');
            })

but, its not working for finding 2nd or last word of a name; as,in "Mohoshin Ara Tahera", if I search "Mohoshin" it works, but if I search "Ara" or "Tahera" or "Mohoshin Ara" it's not showing any result.

04 Apr
2 weeks ago

nionta left a reply on Getting Value From Another Table Through Id

you can join your students_class table with ``students_attendance table throughclass_id` and select the class_name column and get, something like

    DB::table('students_attendance_register')

->join('students_attendance ','students_attendance_register.students_attendance _id','=','students_attendance .id') ->join('students_class ','students_attendance .class_id','=','students_class .class_id') ->select('students_class .class_name as class_name ') ->get();

16 Jan
3 months ago

nionta left a reply on WhereNull Is Not Working

here is the raw query:

    "string(908) "select `units`.`name` as `unit_name`, `army_movements`.`start_date` as `start_date`, `army_movements`.`end_date` as `end_date`, `army_movements`.`id` as `army_movement_id`, `army_movements`.`part2_no` as `part2_no`, `service_life_events`.`name` as `movement_type` from `army_movements` inner join `army_movement_locations` on `army_movements`.`id` = `army_movement_locations`.`movement_id` and `army_movement_locations`.`location_type` = ? inner join `units` on `army_movement_locations`.`to_location` = `units`.`id` inner join `service_life_events` on `army_movements`.`svc_life_event_id` = `service_life_events`.`id` where 

army_movements.deleted_at is null and (army_movements.army_id = ? and service_life_events.name = ?) or (army_movements.army_id = ? and service_life_events.name = ?) or (army_movements.army_id = ? and service_life_events.name = ?) order by start_date asc" {}"

nionta started a new conversation WhereNull Is Not Working

I have 'AND' function with whereNull with some orWhere, but my whereNull condition is not working. if the column is not Null, even then it query takes the values from the table, which won't be happen. Can anyone solve this problem? Here is my Query:

$movement_detail = DB::table('a_movements') ->join('a_movement_locations',function ($join){ $join->on('a_movements.id','=','a_movement_locations.movement_id'); $join->where('a_movement_locations.location_type','=','Unit'); }) ->join('units','a_movement_locations.to_location','=','units.id') ->join('service_life_events','a_movements.svc_life_event_id','=','service_life_events.id') ->whereNull(a_movements.deleted_at') ->where([['a_movements.army_id','=',$a_id],['service_life_events.name','=','Permanent Posting']]) ->orWhere([['a_movements.army_id','=',$a_id],['service_life_events.name','=','b_Posting']]) ->orWhere([['a_movements.a_id','=',$army_id],['service_life_events.name','=','a_Posting']]) ->select('*') ->orderBy('start_date','asc') ->get();

31 Oct
5 months ago

nionta left a reply on How To Manually Install DomPDF In Server Project

@bobbybouwmann , actutally I updated my project on server before installed dompdf in my local project ; I don't want to re update the project on server, just want to install the pdf packages

29 Oct
5 months ago

nionta started a new conversation How To Manually Install DomPDF In Server Project

I have install domPDF with composer in my project which is in localhost; I have the same project in server; But I have to install domPDf also in the server project, and have to do it manually. can any one give me the procedure?

17 Oct
6 months ago

nionta started a new conversation $.getJSON Between A .foreach() Loop

here is my code:

    $('#sub_program_details').empty();

                     data.parent_sub_programs.forEach(function (element) {
                         var a = 0;
                        // console.log(element);
                         existing_sub_program.forEach(function (existing) {
                             if(element.parent_program_id == existing.admitted_sub_program){
                                 a = 1;
                             }
                         });
                         var HTML="";

                         HTML+='<tbody>';

                         HTML+='<tr>';
                         HTML+='<th>';
                         if(a==1){
                           HTML+='<input type=checkbox class="parent" id="'+element.parent_program_id+'" name="sub_program_checking[]" value="'+element.parent_program_id+' '+element.parent_program_fee+'" checked disabled>  '+element.parent_program_name+'';
                         }
                         else{
                             HTML+='<input type=checkbox class="parent" id="'+element.parent_program_id+'" name="sub_program_checking[]" value="'+element.parent_program_id+' '+element.parent_program_fee+'">  '+element.parent_program_name+'';
                         }
                         HTML+='</th>';
                         HTML+='</tr>';
                         //HTML+='</tbody>';
                        // console.log(HTML);
                         console.log('parent');
                         // $('#sub_program_details').append(HTML);
                          console.log('after');
                         $.getJSON('ChildSubProgramSelectionForCompanyProgramYear?company_program_id=' +company_program_id+ '&year=' +year+'&parent_program_id='+element.parent_program_id,function (child) {
                             console.log('before');
                             console.log(child);
                             // var HTML="";
                             //
                             // HTML+='<tbody>';
                             child.child_sub_programs.forEach(function (e) {

                                 console.log(e);
                                 var b = 0;
                                 existing_sub_program.forEach(function (existing) {
                                     if(e.sub_program_id == existing.admitted_sub_program){
                                         b = 1;
                                     }
                                 });
                                 HTML+='<tr>';
                                 HTML+='<td>';
                                 if( b==1){
                                     HTML+='<input type=checkbox id="'+e.sub_program_id+'" name="sub_program_checking[]" class="'+element.parent_program_id+'" value="'+e.sub_program_id+' '+e.sub_program_fee+'" checked disabled>  '+e.sub_program_name+'';
                                 }
                                 else{
                                     if($("#"+element.parent_program_id).prop("disabled")){
                                         console.log('yes');
                                         HTML+='<input type=checkbox id="'+e.sub_program_id+'" name="sub_program_checking[]" class="'+element.parent_program_id+'" value="'+e.sub_program_id+' '+e.sub_program_fee+'" >  '+e.sub_program_name+'';

                                     }
                                     else{
                                         HTML+='<input type=checkbox id="'+e.sub_program_id+'" name="sub_program_checking[]" class="'+element.parent_program_id+'" value="'+e.sub_program_id+' '+e.sub_program_fee+'" disabled>  '+e.sub_program_name+'';

                                     }
                                 }
                                 HTML+='</td>';
                                 HTML+='</tr>';
                             });
                             HTML+='</tbody>';
                            // console.log('child');
                             $('#sub_program_details').append(HTML);
                         });

                     });

I want to print : parent after before parent after before (as there is two parent_program).

but it prints: parent after parent after before before;

Why? and what could be the solution?

29 Sep
6 months ago

nionta started a new conversation Update Attribute Using Radio Button

I have two radio button named company_status in my #edit-modal which values are active & inactive; when I will click on a edit button , based on the existing status of the company, the radio button will be selected automatically; how can I do that?

here is my view file code:

                <tr>
                                    <td>
                                        <input type="checkbox" name="checkbox_for_delete_multi_id[]"        value="{{$company->id}}">
                                    </td>
                                    <td class="com_name">{{$company->company_name}}</td>
                                    <td class="com_status">{{$company->company_status}}</td>
                                    <td name="created_at">{{$company->created_at}}</td>
                                    <td name="updated_at">{{$company->updated_at}}</td>
                                    <td>
                                        <a href="#" class="edit-model" data-toggle="modal" data-target="#EditModel" data-id="{{$company->id}}" data-company_name="{{$company->company_name}}" data-status="{{$company->company_status}}">
                                            <span style="color: green"><i class="glyphicon glyphicon-edit"></i></span>
                                        </a>
                                    </td>
                                </tr>




        <div class="modal fade" id="EditModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">Edit Company Info</h4>
            </div>

            <form id="company_edit_form" method="post">
                {{ csrf_field() }}
                <div class="modal-body">
                    <div class="form-group">
                        <h5>Company Name</h5>
                        <input class="form-control" id="edited_company_name" name="edited_company_name">
                    </div>
                    <div class="form-group">
                        <h5>Company Name</h5>
                        <input type="radio" class="edited_company_status" name="edited_company_status"  value="active">

                        <input type="radio" value="inactive" class="edited_company_status" name="edited_company_status">

            </div>




    
        $('#EditModel').on('show.bs.modal', function (event) {
            var button = $(event.relatedTarget) // Button that triggered the modal
            var company_name = button.data('company_name') // Extract info from data-* attributes
            // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
            // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
            var modal = $(this)
            modal.find('.modal-body #edited_company_name').val(company_name);
            //modal.find('.modal-body #edited_company_staus').val(company_name);
        })
28 Sep
6 months ago

nionta left a reply on Query Execution Test

@ohffs , yes... but I can not identify how to use transactions between a function.

nionta left a reply on Query Execution Test

@ohffs, yes... but I caould not understand how to use transaction in a method?

nionta started a new conversation Query Execution Test

I want to know that does laravel have any builtin way that, "if i have multiple query between a single function/method ,then if any of those query return an exception , the all query result (data saving in the table) that is being executed successfully before the unsuccessful query, will be removed from database table." ????

12 Sep
7 months ago

nionta started a new conversation Loop Inside An Append()

I want something like this:(though my code is not appropriate)

 branchObj.forEach(function (element) {
                                choice_per_question = element.choice_per_question;
                                total_question = element.total_question;
                                question_per_block = element.question_per_block;
                                no_of_td = total_question/question_per_block;
                                $('#ans_set_table').append(
                                    for(var i = 1;i<=question_per_block ;i++){
                                        '<tr>'+
                                       for(var j = 1;j<=no_of_td ;j++){
                                            '<td>'+
                                           for(var k = 1;k<=choice_per_question ;k++){
                                                '<input type="checkbox">'+
                                            };
                                            '</td>'+
                                        };
                                        '</tr>'
                                    };
                               );
                            });

how can I use a loop inside an append()??? can anyone help me?

08 Sep
7 months ago

nionta started a new conversation Checkbox Click Event

here is my Jquery:

 $(".subjectCheckbox").on('change',function() {
            $("input[name='subject_multi_id[]']").each(function() {
                if(this.checked) {
                        console.log($(this).val());
                }
            });
         });

and this is my checkbox on which I am working:

$('#subject_value').append(
                                    '<tr><td>' + '<input class="subjectCheckbox" type="checkbox" id="subject_multi_id[]" name="subject_multi_id[]" value="' + element.subject_id + '"  >' +
                                    element.subject_name + '</td></tr>');

once I checked a checkbox, i want to show the value on the console, again when I check another checkbox, that will again show the value. but my jquery is not working. any one can help me here?

04 Sep
7 months ago

nionta left a reply on Data Is Not Saving In Database

@newbie360 I have found the solution , I was not passing button_action into the controller function.. now it's working fine, thank you

nionta left a reply on Data Is Not Saving In Database

@ bobbybouwmann , yes $month_year_multi_ids = $request->get('checkbox_Names'); return the right values

nionta started a new conversation Data Is Not Saving In Database

this is my controller file :

public function postdata(Request $request) { $month_year_multi_ids = $request->get('checkbox_Names'); $company = $request->get('company');

    foreach ($month_year_multi_ids as $key => $value) {
        $last_space = strrpos($value, ' ');
        $year[] = substr($value, $last_space);
        $month[] = substr($value, 0, $last_space);
    }

    $validation = $request->validate([

        'company' => 'required',
        'checkbox_Names' => 'required',

    ]);

    $error_array = array();
    $success_output = '';


    if ($request->get('button_action') == "insert")
    {
        foreach ($month_year_multi_ids as $index => $values) {
            $company_year = new CompanyYear([

                'company_id'  => $company,
                'year' => $year[$index],
                'month' => $month[$index],

            ]);
            $company_year->save();
        }

    }
    $success_output = '<div class="alert alert-success">Data Inserted</div>';

    $output = array(
        'errror' => $error_array,
        'success' => $success_output
    );
    echo json_encode($output);

}

data is showing success , but data is not saving in database. also $company, $year and $month variable is showing the right value. where is the problem? why the data is not saving?

03 Sep
7 months ago

nionta started a new conversation Symfony\\Component\\HttpKernel\\Exception\\HttpException Exception

I am facing "exception": "Symfony\Component\HttpKernel\Exception\HttpException" in my laravel file, here is my .ajax-jquery script:

$('#companyyear_form').on('submit', function(event){
            event.preventDefault();
            var company = $('#company').val();
            var checkbox_Names = new Array();
            $("input[name='month_year_multi_id[]']").each(function(){
                if($(this).is(':checked')&& $(this).is(':enabled')) {
                    checkbox_Names.push($(this).val());

                }

            });
            console.log(checkbox_Names);
            console.log(company);
           
            $.ajax({
                headers: {
                             'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                         },
                url: 'postcompanyyear',
                method:'POST',
                data: {
                    company:company,
                    checkbox_Names:checkbox_Names,
                },
                dataType: 'json',
                success: function(data)
                {
                    console.log(data);
                    $('#form_output').html(data.success);
                    $('#companyyear_form')[0].reset();
                    $('#action').val('Add');
                    $('.modal-title').text('Add Program');
                    $('#button_action').val('insert');
                },
                error:function(data)
                {
                    console.log(data);
                }


            })
        });

and here is my controller:

        public function postdata(Request $request)
{
    $month_year_multi_ids = $request->get('checkbox_Names');

    foreach ($month_year_multi_ids as $key => $value) {
        $last_space = strrpos($value, ' ');
        $year[] = substr($value, $last_space);
        $month[] = substr($value, 0, $last_space);
    }

    $validation = $request->validate([

        'company' => 'required',
        'checkbox_Names' => 'required',

    ]);

    $error_array = array();
    $success_output = '';


    if ($request->get('button_action') == "insert")
    {
        foreach ($month_year_multi_ids as $index => $values) {
            $company_year = new CompanyYear([

                'company_id'  => $request->get('company'),
                'year' => $year[$index],
                'month' => $month[$index],

            ]);
            $company_year->save();
        }


    }
    $success_output = '<div class="alert alert-success">Data Inserted</div>';

    $output = array(
        'errror' => $error_array,
        'success' => $success_output
    );
    echo json_encode($month_year_multi_ids);

}

and this is my postcompanyyear route:

Route::post('postcompanyyear','[email protected]');

may be the data is not passing, can you tell me, why I am getting the exception?? and also the solution.

27 Aug
7 months ago

nionta left a reply on Validation Checking For Input Exist In An Array

@Cronix wow!! It's like a magic!!!!!!!!! it's working

nionta left a reply on Validation Checking For Input Exist In An Array

by the way, thanks for trying to help this much.

nionta left a reply on Validation Checking For Input Exist In An Array

No error, just inserting the input values in Database though the value exist in the array. and dd($program_names) showing the array values correctly.

nionta left a reply on Validation Checking For Input Exist In An Array

@Cronix , I have tried this, but not working

nionta left a reply on Validation Checking For Input Exist In An Array

@Cronix, okay... I am sharing my actual code:

$program_names =      DB::table('programs')->where('company_id',$company_id)->select('program_name')->get();
   
    $validation = $request->validate([

            'program_name' => [
                                'required',
                                Rule::notIn($program_names),
                                ],
          
         
        ]);

nionta left a reply on Validation Checking For Input Exist In An Array

@Cronix , okay.. It's may be my mistake that I can not understanding you what I am telling about the problem I am facing, I am trying for the last time, I wish you will understand. so the problem is , this code is working fine for me:

    (1)
use Illuminate\Validation\Rule;

// ...

$yourArray = [val1, val2];

'input' => [
'required',
Rule::notIn(['val1', 'val2']),
]

but this cde is not working properly:

    (2)
use Illuminate\Validation\Rule;

// ...

$yourArray = [val1, val2];

'input' => [
'required',
Rule::notIn($yourArray ),
]

but I need something like No.(2), where I just the array name is being used, not the array elements value like No.(1).

nionta left a reply on Validation Checking For Input Exist In An Array

@Cronix, yeah

    use Illuminate\Validation\Rule;

// ...

$yourArray = [val1, val2];

'input' => [ 'required', Rule::notIn($yourArray), ];

this code logically have to do that what I am requiring in my example, but the line Rule::notIn($yourArray) is not working for me; I am facing this problem, because not error is showing when I am inputting the same value which is exist is $yourArray.

nionta left a reply on Validation Checking For Input Exist In An Array

@Abi can you help me how I can do it by not specified the array values?

nionta left a reply on Validation Checking For Input Exist In An Array

@Cronix , your first code where you have write

'input' => [ 'required', Rule::notIn($yourArray), ]

here, the validation is not working. I don't need the second one, where you have specified the array values,I need something like the first one. can you help me here?

nionta left a reply on Validation Checking For Input Exist In An Array

@goatshark, I am not searching for this, in you provided documentation,here the validation is for checking every element of an array type input. but in my question, I am looking for validate a single string type input, if the input exist in an given array.

nionta started a new conversation Validation Checking For Input Exist In An Array

hello, I am wondering if there any process to check a validation in laravel that, the input is required and it has to be not_exist in an array ?? something like:

$array={ , , , , ...};

'inuput' =>required|not_include/not_exist_in '$array';

nionta left a reply on Loop Between Append

@lancecoder though your answer is not the direct solution, but it helped me a lot, thank you

26 Aug
7 months ago

nionta started a new conversation Loop Between Append

I want to checked a check box if it fill up a conditions, I want to check the condition into a append function. here is my code

if(index=='branchprograms')
                          {
                             branchObj.forEach(function(element) {
                             
                              
                              arr = element.branches_program_id;
                             });
                          }

    else
                          {
                              console.log(arr);
                              branchObj.forEach(function(element) {
                              $('#progvalue').append(
                                  '<tr><td>'+'<input type="checkbox" name="program_multi_id[]"          value="'+element.program_id+'" for(var i = 0; i < arr.length;i++){ if(element.program_id == arr[i]) checked }>'+element.program_name+'</td></tr>');
                             });
                          } 

but in else condition the neither the for loop nor the if condition is working. can anyone help, what the code should be?

08 Aug
8 months ago

nionta left a reply on Route Is Not Loading In Addressbar

@lostdreamiter_nl , thank's. it's loading on the address-bar now, but what I have to done is, I have to reload the browser, only then the next view page is showing; can you please tell me how to solve this problem?

nionta left a reply on Route Is Not Loading In Addressbar

@Smally , I think this is not the solution what I am finding. you have just give a solution for value passing, but I can passing my value to the controller file, there's no problem. thank you :)

nionta left a reply on Route Is Not Loading On Adress Bar

okay, I could pass the value, but even here the url is not loading

nionta left a reply on Route Is Not Loading In Addressbar

this is my javascript in view file:

 $('#academicuserbtn').click(function() {
               var company_id = $('#company option:selected').val();
               var person_type = $('#role option:selected').val();
             $.ajax({
             url: 'acamedicpersonentry/{company_id}/{person_type}',
             type: 'GET',
             data: { company_id:company_id,
             person_type:person_type
              },
             success: function(response)
             {
                 console.log('okay');
             }
            
             });
             console.log(company_id);
            console.log(person_type);
           });

nionta left a reply on Route Is Not Loading In Addressbar

I am not facing any problem, the code working fine, and I have checked that the button getting the routes(checked in web-network), the problem is only that "url is not loading in the address-bar"

nionta started a new conversation Route Is Not Loading In Addressbar

this is my code:

 public function valuepass(Request $request)
{   
    $person_type = $_GET['person_type'];
    $company_id = $_GET['company_id'];

    dump($person_type);
    $allentryfields = DB::table('fields')
                    ->where([['fields.company_id',$company_id],['fields.person_type',         $person_type]])
                    ->join('field_types','fields.field_type_id','=','field_types.id')
                    ->select('fields.id as field_id','fields.field_name as field_name','field_types.type_name as type_name')
                    ->get();

 
    return view('admin.academicuser.createuser',compact('allentryfields'));

}

here the method 'valuepass' is getting two variable named person_type and company_id, along with this I want to change my view page, for this I have used "return view", there is no error and the button which onclick function return this valuepass method, also access on the view page, which I have checked in the web-network section. But problem is, the view page is not loading in the address-bar,

this is my route:

Route::get('acamedicpersonentry/{company_id}    /{person_type}','[email protected]'); 

how, can I solve this?

I have also tried this one:

 public function valuepass(Request $request)
{   
    $person_type = $_GET['person_type'];
    $company_id = $_GET['company_id'];

    dump($person_type);
    $allentryfields = DB::table('fields')
                    ->where([['fields.company_id',$company_id],['fields.person_type',  $person_type]])
                    ->join('field_types','fields.field_type_id','=','field_types.id')
                    ->select('fields.id as field_id','fields.field_name as field_name','field_types.type_name as type_name')
                    ->get();

   // return View('admin.academicuser.createuser', array('allentryfields' => $allentryfields));
    //return view('admin.academicuser.createuser',compact('allentryfields'));
   //return Redirect::route('academicuser/createuser')->with('allentryfields', $allentryfields);
   return redirect('academicuser/createuser')->with('allentryfields', $allentryfields);
   //                 return $allentryfields;

}


 public function index()
{
    $allentryfields = session()->get( 'allentryfields' );
    return view('admin.academicuser.createuser',compact('allentryfields'));

}

but, here is also the same problem, everything is okay but not loading in the address-bar, what could be the solution?

07 Aug
8 months ago

nionta left a reply on Route Is Not Loading On Adress Bar

@Shahrukh4 thank you, but I have tried this, can you please help me that how can I pass the variabel '$allentryfields' to that route, as this is what I had done before to pass: my Route was:

 Route::resource('academicuser/createuser','AcademicUserEntryController');

and this was my 'viewpass' method:

 return redirect('academicuser/createuser')->with('allentryfields', $allentryfields);

and this is the function:

public function index()
{
    
    return view('admin.academicuser.createuser',compact('allentryfields'));

}

but, the variable 'allentryfields' was not passing to the view file.

nionta started a new conversation Route Is Not Loading On Adress Bar

this is my code:

 public function valuepass(Request $request)
{   
    $person_type = $_GET['person_type'];
    $company_id = $_GET['company_id'];

    dump($person_type);
    $allentryfields = DB::table('fields')
                    ->where([['fields.company_id',$company_id],['fields.person_type',         $person_type]])
                    ->join('field_types','fields.field_type_id','=','field_types.id')
                    ->select('fields.id as field_id','fields.field_name as field_name','field_types.type_name as type_name')
                    ->get();

 
    return view('admin.academicuser.createuser',compact('allentryfields'));

}

here the method 'valuepass' is getting two variable named person_type and company_id, along with this I want to change my view page, for this I have used "return view", there is no error and the button which onclick function return this valuepass method, also access on the view page, which I have checked in the web-network section. But problem is, the view page is not loading in the address-bar,

this is my route: Route::get('acamedicpersonentry/{company_id} /{person_type}','[email protected]');

how, can I solve this?

06 Aug
8 months ago

nionta left a reply on Passing Variable Between Two Functions In Same Controller

@Tray2 , have checked ,but the dd($person_type) result has a value

nionta left a reply on Passing Variable Between Two Functions In Same Controller

okay, nut I'm just returning one variable, why that's not working? can you please tell me the solution for that?

nionta started a new conversation Passing Variable Between Two Functions In Same Controller

Here is my code:

public function companyandpersonselection(Request $request)
{
    $person_type = $request->get('person_type');
    $company_id = $request->get('company_id');
    
     return $person_type;
    
   
}

/**
 * Show the form for creating a new resource.
 *
 * @return \Illuminate\Http\Response
 */
public function valuepass(Request $request)
{
   $test = $this->companyandpersonselection($request);
   dump($test);
   
    
   // return view('admin.academicuser.createuser');

}

but,my second function pass out ""null", but in 1st one the "variable" has a value. why it's not working?

04 Aug
8 months ago

nionta started a new conversation Set HTML Input Field "type"

Is it possible to set input field "type" from taking type that store in database table. I have a table "field_types" and a table "fields", I have stored some field name with their types using "field_types" table "id". Now I want to create a HTML form, and take input from user in those fields, but also, I want to declare the input "type" by taking database saved type. How to do it in laravel? and even is it possible?

24 Jul
8 months ago

nionta started a new conversation Take Multiple Array Values

I want to update multiple rows. Here is my controller file: $ids = [$request->get('com_id')]; $name = [$request->get('com_name')]; $stat = [$request->get('com_status')]; $now = Carbon::now(); $count = count($ids);

    // $ids = $request->get('com_id');
        // die($ids);
      // $companies = companies::find($ids);
       $thiss=$request->validate(
        ['com_name' => 'required',
         'com_status' => 'required'
        ]);
       // $i=0;
       for ($i=0; $i <$count ; $i++) { 
        $companies = companies::find($ids[$i][0]);
           companies::where('id',$ids[$i][0])
        ->update(['company_name' => $name[$i][0],
                 'status' =>  $stat[$i][0]
                 ]);

but in my code, Just the 1st row is being updated. what can I do for updating multiple rows with array index number?

nionta left a reply on 422 In Update Method

yeap; but can you tell me the solution?

nionta left a reply on 422 In Update Method

have done this also, but not working, same 422 error, means "data is invalid".

nionta left a reply on 422 In Update Method

what is "ids" here?