Haroon1296

Haroon1296

Member Since 1 Month Ago

Experience Points
490
Total
Experience

4,510 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 1
490 XP
Oct
17
1 week ago
Activity icon

Started a new Conversation Execute Function Before Refresh

On my HTML page, when the user clicks / presses F5 button the page refreshes, but before it refreshes I want to execute a function or a simple alert.

User can click on refresh button, press F5 or Ctrl + R.

Using jQuery

Oct
07
2 weeks ago
Activity icon

Replied to How To Get Id Of Newly Created User And Pass It To A Controller

You just pate this

$vendorReg->save();

after

$vendorReg->password = .....;

if you already did this then see in your Database users table is exits . if not then run this command

php artisan migrate
Activity icon

Replied to How To Get Id Of Newly Created User And Pass It To A Controller

You did not save user after this line

$vendorReg->password = $request->input('password')

paste this code

$vendorReg->save();

then you get user Id.

Oct
05
2 weeks ago
Activity icon

Started a new Conversation How To Show Alert To Specific User?

Hi,

Here is two variables in javascript. i want to show alert where user Id = to_user_id

to_user_id = 10 ;
from_user_id = 2 ;
Oct
03
3 weeks ago
Activity icon

Replied to How To Delete File From My Local Storage

I did this

public function delete($id)
    {
        
        $file = File::findOrFail($id);

        $image_path = public_path("build/images/" . $file->classification . "/" . $file->file . "");

        unlink($image_path);
     
        $file->delete();

        return redirect()->back();
    }

this best practice or not? @automica , @laracoft

it's working properly.

Activity icon

Replied to How To Delete File From My Local Storage

i did not get my file name simple i delete record from my database.

i delete file and record at a same time. How?

@laracoft

Activity icon

Replied to How To Delete File From My Local Storage

File is my modal name How i can do this? @automica

Activity icon

Started a new Conversation How To Delete File From My Local Storage

Hi, I want to delete my file from my local storage if user delete the any file / record. Here is my code ....

public function delete($id)
{
    File::where('id', $id)->delete();
    return redirect()->back();
 }
Oct
02
3 weeks ago
Activity icon

Replied to Convert Raw DB To Laravel Eloquent

App\HrLeaveRequest::select(DB::raw("IFNULL(SUM(no_of_days),0) as no_of_days"))
                    ->where([
                        'employee_id' => $userEmployee,
                        'leave_type_id' => $request->id,
                        'leave_status' => 4
                    ])
                    ->whereYear('created_at', '=', date('Y'))->first();
Oct
01
3 weeks ago
Activity icon

Replied to TokenMismatchException

in app.blade.php paste it inside the < head > tag

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">
Sep
29
3 weeks ago
Activity icon

Replied to How To Calculate The Sum Of Values In An Array ?

$product_quantity= array ( 0 => "23", 1 => "32" );

    $sum = 0;
    for($i = 0; $i < count($product_quantity); $i++){
        $sum += $product_quantity[$i];
    }

$order=DB::table('orders')->update([ 'invoice_no'=$request->invoice_no, 'loading_port'=$request->loading_port, 'quantity'= $sum, ])

Sep
26
4 weeks ago
Activity icon

Started a new Conversation Calculate No. Of Financial Year Between Two Dates

Hi, i want to Calculate no of financial Year counts between two dates

$start_date = "2020-01-01 00:00:00";
    $end_date = "2025-02-01 23:59:59";

    // financial Year Dates
    $financial_year_opening_date = '2019-07-01 00:00:00';
    $financial_year_closing_date = '2020-06-30 00:00:00';
Sep
24
1 month ago
Activity icon

Replied to Session Destroy After Redirect Other Route?

in Middlware/Authenticate

protected function redirectTo($request)
{
    if (! $request->expectsJson()) {
        return route('login');
    }
}

replace into ....

protected function redirectTo($request) { if (! $request->expectsJson()) { return route(' Youre route here '); } }

and in route.php

Route::get('/','[email protected]');

Route::group(['middleware' => ['auth']], function(){ // routes here... });

You can make another Middlware and just put it...

Activity icon

Replied to Raw SQL Query To Array

$data = $query->toArray();

Activity icon

Replied to Object To Array

dd($request->hasFile('images'));

Sep
23
1 month ago
Activity icon

Started a new Conversation WhereBetween Not Working.

$record_date_from = Carbon::createFromFormat('d/m/Y',$record_date_from)->startOfDay()->toDateTimeString();

$record_date_to = Carbon::createFromFormat('d/m/Y',$record_date_to)->endOfDay()->toDateTimeString();

$transaction = Transactions::where('transactions.status', '=', 1) ->where('transactions.party_from', $ch_description->id) ->whereBetween('transactions.transaction_date', [$record_date_from, $record_date_to]) ->join('ch_descriptions as ch_descriptions', 'ch_descriptions.id', '=', 'transactions.party_from') ->groupBy('transactions.party_from') ->join('vouchers', function($join){ $join->on('vouchers.voucher_id', '=', 'transactions.voucher_id'); $join->on('vouchers.classification','=','transactions.classification'); })->get();

if i comment whereBetween condition record is show But if i unComment whereBetween condition record is Not show.

And i also Try this... but not working. ->where('transactions.party_from', '>', $record_date_from); ->where('transactions.party_from', '<', $record_date_to);

Activity icon

Replied to Trouble With Resource Controller

This single route declaration creates multiple routes to handle a variety of RESTful actions on the users resource. Likewise, the generated controller will already have methods stubbed for each of these actions, including notes informing you which URIs and verbs they handle.

Here is official documentation...

https://laravel.com/docs/5.2/controllers#restful-resource-controllers

Sep
21
1 month ago
Activity icon

Replied to How Submitting Of Data With Ajax-requests Show Server Validation Errors ?

// html

// in ajax success request check server validation errors.

		var html = '';

                    if(data.errors){
                      $('.2nd-row, html').animate({scrollTop:$('.2nd-row').offset().top}, 'slow');
                        html = '<div class="alert alert-danger">';

                        for(var count = 0; count < data.errors.length; count++){

                            html += '<p>' + data.errors[count] + '</p>'; 
                        }

                        html += '</div>';
                      $('#form_result').html(html);
                        
                    }
Activity icon

Replied to How To Update Data Of Specific User With One To Many Relationship

$project = Projects::with('dev_name')->get();

//I don't have dev_name column in my Projects table $developer = Developer::whereIn('id', $project->pluck('dev_name_id'))->get();

for ($i =0; $i < count($developer) as $i++) {
    $dev->debt = $sums[$i];
    $dev->save();
}

//I don't have dev_name_id column in my Projects table either $grouped = $project->groupBy('dev_name_id'); $sums = $grouped->map->sum(function($projects) { return $projects->dev_expense; });