Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

umair33

umair33

Member Since 1 Month Ago

Experience Points
300
Total
Experience

4,700 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
300 XP
Nov
17
6 days ago
Activity icon

Replied to How To Update All Rows In A Column ?

but i need to get a value from and the db and update it

Activity icon

Started a new Conversation How To Update All Rows In A Column ?

i have a column in the db called name i want to run a function on all of them and update with the new value

  public  function slugify($text)
    {
        $text = preg_replace ("/(ː)/", "", $text);
        $text = preg_replace('~[^\pL\d]+~u', '-', $text);

        $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);

        $text = preg_replace('~[^-\w]+~', '', $text);


        $text = trim($text, '-');


        $text = preg_replace('~-+~', '.', $text);


        if (empty($text)) {
            return 'n-a';
        }

        return $text;
    }

Oct
26
4 weeks ago
Activity icon

Replied to Eloquent Returning The Same Results

yes but its always the same and its not the one with that slug

Activity icon

Started a new Conversation Eloquent Returning The Same Results

eloquent returning the same results for every slug i dont know why here is my query

declare(strict_types=1);

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Group;

class Data extends Controller
{
    public function getData(string $slug)
    {
        $data = Group::with(['meta' => function ($q) use ($slug) {
            $q->where('slug', '=', $slug);
        }])->take(1)->get();
        return response()->json($data);
    }
}


<?php
declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Meta extends Model
{
   
    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function group(): \Illuminate\Database\Eloquent\Relations\HasMany
    {
        return $this->hasMany(Group::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany*
     */
    public function genres(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
    {
        return $this->belongsToMany(Genre::class);
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function persons(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
    {
        return $this->belongsToMany(Person::class);
    }
Oct
22
1 month ago
Activity icon

Started a new Conversation How To Run Function On Data After Its Fetched From Db ?

i need to run a function the email column after its fetched from db how can i do that in the model it self the code base is way to big for me to call the function everywhere

i am coming from phlacon this is a how its done there i would like to know how to do in laravel

public function afterFetch()
	{
	

		$this->email= myfun($this->email);
		
	}
	
Oct
18
1 month ago
Activity icon

Replied to How Can I Pass More One Optional Parameter In The Route

thank you this works for me

$router->get('import[/{name}[/{info}]]','[email protected]');

Activity icon

Replied to How Can I Pass More One Optional Parameter In The Route

@rodrigo.pedra , @sinnbeck tried but not working too.

Cannot register two routes matching "/api/v1/import" for method "GET"

Activity icon

Started a new Conversation How Can I Pass More One Optional Parameter In The Route

i am trying to pass more then one optional Parameter in my route

    'middleware' => 'auth:api',
    'prefix' => 'api/v1'
], function () use ($router) {
    $router->get('import[/{name}/{info}]','[email protected]');
});

if info is empty i get a 404 i am using lumen 8