EMfinanga

EMfinanga

Member Since 1 Year Ago

Experience Points
7,480
Total
Experience

2,520 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 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 2
7,480 XP
Oct
21
5 days ago
Activity icon

Replied to Select Specific Users Base On Selected Option

@tykus you may check now, if you need the explanation you can email me

Activity icon

Replied to Select Specific Users Base On Selected Option

@tykus , ok will do this right now

Activity icon

Replied to Select Specific Users Base On Selected Option

i think, will stack much, so that why i need to show you what i have done, or we can use Zoom no worries @tykus

Then will share the result here as best answer

Activity icon

Replied to Select Specific Users Base On Selected Option

@tykus , thank you sorry may i show my code in my side please, emma4082@gmail.com

Activity icon

Replied to Select Specific Users Base On Selected Option

am not using JS framework, may be we can use one of them its ok for me

Activity icon

Replied to Select Specific Users Base On Selected Option

@tykus

how can I use in the blade view?, because i want to get a list of users when i select the team name

               <label>Team</label>
          <select class="form-control select2"  data-placeholder="Select a State"
          style="width: 100%;">
          <option>[SELECT]</option>
        @foreach($teamlist as $key=>$type)
       <option value="{{$key}}">{{$type}}</option>
        @endforeach
        </select>
      </div>

    </div>

    <div class="col-md-6">
      <div class="form-group">
        <label>Requested By:</label>
        <select class="form-control select2"  data-placeholder="Select a State"
        style="width: 100%;">
        <option>[SELECT USERS]</option>
       
      </select>
    </div>
Oct
20
6 days ago
Activity icon

Started a new Conversation Select Specific Users Base On Selected Option

I have a table of users and each users has specific team such as team 1, team 2 .... so i want when i select team 1 i can get the users which are in team 1.

How can i write this in controller,

Oct
06
2 weeks ago
Activity icon

Replied to AutoComplete Search A List Of Numbers In Laravel

@snapey how can i make autocomplete search from two table if you have a list of numbers

Activity icon

Started a new Conversation AutoComplete Search A List Of Numbers In Laravel

I want to search a list of numbers like 123 345 787 0998 From a two different table,

supposed the Tb 1 has number 123 345 Tb 2 has number 787 0998

How can i do this in my input search form,

Jul
18
3 months ago
Jul
17
3 months ago
Activity icon

Replied to Count Hours After Created Data Using Laravel

yes Sir @snapey , how can do it in controller and blade

Activity icon

Started a new Conversation Count Hours After Created Data Using Laravel

I want to count a time example 3 hrs after created data, then to allow user within a three hours he can able to cancelled the bill,

kindly advice me the base way how i can do this

Activity icon

Replied to Delete Multiple Data

@van1310 , i used above replied and resolve my problem,

Thank bro very much

Jul
16
3 months ago
Activity icon

Replied to Delete Multiple Data

@van1310 , I know where id the error i takes the unit_number instead of unit_id

                         DB::table("issued_uploads")->whereIn('unit_id', $unitIssued)->delete();
Activity icon

Replied to Delete Multiple Data

array:2 [▼ 0 => "7200408112" 1 => "7200408003" ]

Activity icon

Started a new Conversation Delete Multiple Data

on my code the delete query does not delete the data, someone can help me where i did wrong

      public function issuedto(Request $request){

         $unit_id = $request->unit_id;
        // dd($request);

                    $unitIssued=store::whereIn('unit_id',$request->unit_id)->pluck('id');

                        
            $i=0;
                    foreach ($unitIssued as $value) {

                    IssuedUnit::create([
                        'unit_id' => $unitIssued[$i],
                        'issued_by' => Auth::user()->id,
                        'issued_to' => $request->selectTeam,
                        'req_by' => $request->inputSelect,
                       
                    ]);

                 //delete multiple data
                  DB::table("issued_uploads")->whereIn('unit_id', $unit_id)->delete(); 
            $i++;
            

        }

          return redirect()->back()
                                ->with('success',' Updated successfully.');
Jul
15
3 months ago
Activity icon

Replied to Insert Multiple Id To Another Table

Actualy both is answer

Activity icon

Started a new Conversation Insert Multiple Id To Another Table

I have the ajax, which pass the id like this 1,2,3

but when i create it, it save all id in one row, so what can i do to insert those list id

my controller

public function addMultipleUnit(Request $request){

        $ids = $request->ids;
       // $idsList=explode(",",$ids);
      // dd($ids);
 
  
            foreach ($ids as  $key=> $value) {
            IssuedUpload::create([
                'unit_id' => $ids[$key],
            
                ]);


               }   

           return response()->json(['status'=>true,'message'=>"added successfully."]);   

          // }
         }
Jul
14
3 months ago
Activity icon

Replied to Search A List Of Data

thank you @ltroya

Activity icon

Replied to Search A List Of Data

@van1310 this code is works but how can i add another condition to search all if the status=0

      $string = $request->UnitIdList;


        // split on 1+ whitespace & ignore empty (eg. trailing space)
        $searchValues = preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY); 

        $unitList = store::where(function ($q) use ($searchValues) {
          foreach ($searchValues as $value) {
            $q->orWhere('unit_id', 'LIKE', '%' .$value. '%');
          }
        })->get();

where i can add status=0

Activity icon

Replied to Search A List Of Data

thanks brother, you make my day

Activity icon

Replied to Search A List Of Data

@van1310 , this code it handle single input?, not many input 12334 23445 87878 77878 34455 as you can see here the data is seperated by space

Activity icon

Started a new Conversation Search A List Of Data

I want to search a list of data like : 12334 23445 87878 77878 34455 which i copied from excel and paste it on my search form, then will get that data

kindly advice me the best way and example how i can archieve this

Jul
13
3 months ago
Activity icon

Replied to POST Data To Controller Using Ajax

@michaloravec , Thanks you once again, for your support

Activity icon

Replied to POST Data To Controller Using Ajax

@michaloravec , i would like to ask something am a new in Javascript

I want to put validation here id this id has alread created no need to add again

I tried like this

   public function addUnit_to_issued(Request $request,$id){

            // echo $id;

            $check=IssuedUpload::where('id',$id);
            // dd($check);

            if(!$check){

                IssuedUpload::create([
                    'unit_id' => $id,

                ]); 

            }
            else{
                return redirect()->back()
                ->with(error('Error','not added successfully.'));

            }
            if ($request->wantsJson()) {

                return response()->json([
                    'success' => 'added successfully.'
                ]);
            }
Activity icon

Replied to POST Data To Controller Using Ajax

am get

 		SUCCESS:  
     {success: "Updated successfully."}
      success: "Updated successfully."

i want to store/create this id to another table, kindly can you show me how i can add there

Activity icon

Replied to POST Data To Controller Using Ajax

controller

          public function addUnit_to_issued(Request $request,$id){
              echo $id;

            $id = $request->id;

            dd($id);
                      

            return redirect()->back()
                            ->with('success',' Updated successfully.');
            }

route

          Route::post('addUnit/{id}','[email protected]_to_issued');
Activity icon

Replied to POST Data To Controller Using Ajax

@michaloravec i tried to change but get the same error

Activity icon

Replied to POST Data To Controller Using Ajax

@jlrdw am get the id after alert it

Activity icon

Started a new Conversation POST Data To Controller Using Ajax

I want to pass id from my blade form and store that id to another table,

am try like this but get this error

my blade form

                 <td>
                  <meta name="csrf-token" content="{{ csrf_token() }}">
                  <a href="#" data-id="{{$dt->id}}" id="add_btn" class="btn btn-sm btn-default add_btn ">Issue</i> 
                  </a> </td>
              </tr>
              @endforeach
           </tbody>

my ajax

           $(".add_btn").click(function(e){

               e.preventDefault();
     
              var id = $(this).data("id");

                 var token = $("meta[name='csrf-token']").attr("content");
           

                     $.ajax(
                     {
                      url: "addUnit/"+id, 
                  type: 'POST',
          
                  data: {
                    "id": id,
                    "_token": token,
                  },
                 dataType: 'json',
                    success: function(data) {
                        console.log('SUCCESS: ', data);
                    },
                    error: function(data) {
                        console.log('ERROR: ', data);
                    },
               });
            });

my controller public function addUnit_to_issued(Request $request){

             $id = $request->input('id');
            // store id data to another table here

              dd($id);
                      

            return redirect()->back()
                            ->with('success',' Updated successfully.');
              }

error

             ERROR:  {readyState: 4, setRequestHeader: ƒ, getAllResponseHeaders: ƒ, getResponseHeader: ƒ, 
             overrideMimeType: ƒ, …}

             POST http://127.0.0.1:8000/store/addUnit/1 404 (Not Found)
Jul
07
3 months ago
Activity icon

Replied to Search A List In One Input Form

or can I upload excel file, and search ?

Activity icon

Replied to Search A List In One Input Form

@deepu07 there is no way i can copy and paste those number in once and comes in table row in all at once?

Activity icon

Started a new Conversation Search A List In One Input Form

Hello, How can I search a list of number from one input form,

Example i have this list 12334 23457 3555 6666 7777 separated by space i want to paste on my search input form and and click search button to get those number

Keep in mind that those number are found in one table from DB

Someone can help me

Jun
11
4 months ago
May
31
4 months ago
Activity icon

Awarded Best Reply on Update Or Create New Rows

this is works

              $stockcount= count($stocks);
            $totalPid = count($data['pid']);
            $totalQty = count($data['qty']);
            $totalTruckNumber = count($data['truckNumber']);

            $remain=$totalPid-$stockcount;
    // dd($remain);

            for($i=$stockcount; $i<$totalPid; $i++){      
                Stock::create([
                    'pid' => $request->pid[$i],
                    'qty' => $request->qty[$i],
                    'inv_no' => $request->inv_no,
                    'user_id' => Auth::user()->id,
                    'Indate'=>$date,
                    'supplierName' => $request->supplierName,
                    'receiptNumber' => $request->receiptNumber,
                    'truckNumber' => $request->truckNumber[$i],
                    'driverName' => $request->driverName,
                    'remark' => $request->remark,
                ]);
            }
Activity icon

Replied to Return Another Function With Massage

No, i like to pass the massage in blade view

Activity icon

Replied to Update Or Create New Rows

this is works

              $stockcount= count($stocks);
            $totalPid = count($data['pid']);
            $totalQty = count($data['qty']);
            $totalTruckNumber = count($data['truckNumber']);

            $remain=$totalPid-$stockcount;
    // dd($remain);

            for($i=$stockcount; $i<$totalPid; $i++){      
                Stock::create([
                    'pid' => $request->pid[$i],
                    'qty' => $request->qty[$i],
                    'inv_no' => $request->inv_no,
                    'user_id' => Auth::user()->id,
                    'Indate'=>$date,
                    'supplierName' => $request->supplierName,
                    'receiptNumber' => $request->receiptNumber,
                    'truckNumber' => $request->truckNumber[$i],
                    'driverName' => $request->driverName,
                    'remark' => $request->remark,
                ]);
            }
Activity icon

Replied to Return Another Function With Massage

this is like id so there is the invoice number i passed there

       	Route::get('stock/show/{inv_no}', '[email protected]');
Activity icon

Started a new Conversation Return Another Function With Massage

This return is works but the massage success does not display, what can i change

            return  $this->show($inv_no)->with('success', 'GRN  Edited Successfully ');
Activity icon

Replied to Update Or Create New Rows

@bobbybouwmann array[0,1,2] are in DB, but array[3,4] i want to added in DB

So my logic is the exist array can updated and additional array can be added

            array:10 [▼
              "_token" => "GBMOuQQrICXXO8DvV8FoV35VFKWuJXEok1TlF1o7"
              "inv_no" => "GRN3105200005"
              "supplierName" => "dar"
              "receiptNumber" => "98799x"
              "driverName" => "DD"
              "remark" => "OK"
              "Indate" => "2020-05-31"
              "pid" => array:5 [▼
                0 => "1"
                1 => "2"
                2 => "3"
                3 => "4"
                4 => "5"
              ]
              "truckNumber" => array:5 [▼
                0 => "T 640"
                1 => "T 678"
                2 => "T 220 DRS"
                3 => "T 155"
                4 => "T 640"
              ]
              "qty" => array:5 [▼
                0 => "60"
                1 => "55"
                2 => "40"
                3 => "4"
                4 => "5"
              ]
            ]
May
30
4 months ago
Activity icon

Replied to Update Or Create New Rows

Join Zoom Meeting https://zoom.us/j/91275984788?pwd=MG5VeVZLbFNGdHJSVFlLekRZYzdkZz09

Meeting ID: 912 7598 4788 Password: 1jcLBM

click that link to join sir

Activity icon

Replied to Update Or Create New Rows

@bobbybouwmann no am just share the link for zoom here to connect in my pc and to show you

Activity icon

Replied to Update Or Create New Rows

@bobbybouwmann may i show the my how it works in my end ?

I can share on my zoom

Activity icon

Replied to Update Or Create New Rows

@bobbybouwmann am tried to use count but it update existing data and save one row while i have added more than one rows.

But if i loop i think it can duplicate the data ?

Activity icon

Started a new Conversation Update Or Create New Rows

I have an invoice form so I want to Edit/update row which are exist and add new rows of the same invoice number

this code is update existing one and add one row , but if i add more than one rows does not added all its update exist and add new one .

so i want to update exist and add new all rows which is additional

          public function update(Request $request, $inv_no)
      {

   $data = $request->all();

    $date = date ("Y-m-d",  strtotime($request->Indate));

   $stocks = Stock::where('inv_no', $inv_no)->get();
    $i = 0;

      foreach ($stocks as $stock) { 
      Stock::where('inv_no', $inv_no)
        ->where('id', $stock->id)
        ->update([
            'pid' => $request->pid[$i],
            'qty' => $request->qty[$i],
            'user_id' => Auth::user()->id,
            'Indate'=>$date ,
            'supplierName' => $request->supplierName,
            'receiptNumber' => $request->receiptNumber,
            'truckNumber' => $request->truckNumber[$i],
            'driverName' => $request->driverName,
            'remark' => $request->remark,
        ]);

             $i++;
    }

    $stockcount= count($stocks);
    $totalPid = count($data['pid']);
    $totalQty = count($data['qty']);
    $totalTruckNumber = count($data['truckNumber']);
   // dd($request->pid[$totalPid-1]);

     if ($stockcount < $totalPid ) {

       
        Stock::create([
            'pid' => $request->pid[$totalPid-1],
            'qty' => $request->qty[$totalQty-1],
            'inv_no' => $request->inv_no,
            'user_id' => Auth::user()->id,
            'Indate'=>$date,
            'supplierName' => $request->supplierName,
            'receiptNumber' => $request->receiptNumber,
            'truckNumber' => $request->truckNumber[$totalTruckNumber-1],
            'driverName' => $request->driverName,
            'remark' => $request->remark,
        ]);
     
       }