oxbir

oxbir

Member Since 9 Months Ago

Experience Points
12,720
Total
Experience

2,280 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
3
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 3
12,720 XP
Oct
20
13 hours ago
Activity icon

Started a new Conversation The PUT Method Is Not Supported For This Route. Supported Methods: GET, HEAD.

Look at my codes

AppServiceProvider.php

public function boot()
{
    view()->composer('*', function($view) {
        $view->with('userCount', User::count());
        $view->with('advertise', Advertise::all());
    });
}

edit.blade.php

<form action="{{ route('advertises.edit', $advertise[0]->id) }}" method="post" enctype="multipart/form-data">
        @csrf
        @method('PUT')
        <div class="row">
            <div class="col-md-4">
                <div class="form-group">
                    <label for="image1">تصویر شماره ۱</label>
                    <input type="file" id="image1" name="image1" class="form-control">
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label for="image2">تصویر شماره ۲</label>
                    <input type="file" id="image2" name="image2" class="form-control">
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label for="image3">تصویر شماره ۳</label>
                    <input type="file" id="image3" name="image3" class="form-control">
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label for="image4">تصویر شماره ۴</label>
                    <input type="file" id="image4" name="image4" class="form-control">
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label for="image5">تصویر شماره ۵</label>
                    <input type="file" id="image5" name="image5" class="form-control">
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">
                    <label for="image6">تصویر شماره ۶</label>
                    <input type="file" id="image6" name="image6" class="form-control">
                </div>
            </div>
        </div>
        <div class="form-group">
            <button type="submit" class="btn btn-primary">ذخیره</button>
        </div>
    </form>

web.php

Route::get('advertises/{advertise}/edit', '[email protected]')->name('advertises.edit');
Route::put('advertises/{advertise}/update', '[email protected]')->name('advertises.update');

AdvertiseController.php

public function update(Request $request, Advertise $advertise)
{
    dd($request->all()) ;
}

I get this error.

The PUT method is not supported for this route. Supported methods: GET, HEAD.

Activity icon

Replied to How To Show Socials Network When There Are In Database?

@extjac

I deleted @foreach(auth()->user()->socials as $social)

but I see this demo.

Undefined variable: social (View: C:\xampp3\htdocs\projects\tehran\resumes\resources\views\Home\pdf.blade.php)

Oct
19
1 day ago
Activity icon

Replied to How To Show Socials Network When There Are In Database?

I deleted @foreach(auth()->user()->socials as $social)

but I see this demo.

Undefined variable: social (View: C:\xampp3\htdocs\projects\tehran\resumes\resources\views\Home\pdf.blade.php)

Activity icon

Started a new Conversation How To Show Socials Network When There Are In Database?

I have a socials network like this

socials

When I save in database

database

I have telegram and twitter and facebook social network.

How to return if social_id is there in database?

blade

@foreach(auth()->user()->socials as $social)
    @if ($social->social_id == 1)
        <li>
            <div class="li_wrap">
                <div class="icon"><i class="fab fa-linkedin"></i></div>
                <div class="text">{{ $skill->pivot->link }}</div>
            </div>
        </li>
    @endif
    @if ($social->social_id == 2)
        <li>
            <div class="li_wrap">
                <div class="icon"><i class="fab fa-twitter"></i></div>
                <div class="text">{{ $skill->pivot->link }}</div>
            </div>
        </li>
    @endif
    @if ($social->social_id == 3)
        <li>
            <div class="li_wrap">
                <div class="icon"><i class="fab fa-facebook-square"></i></div>
                <div class="text">{{ $skill->pivot->link }}</div>
            </div>
        </li>
    @endif
    @if ($social->social_id == 4)
        <li>
            <div class="li_wrap">
                <div class="icon"><i class="fab fa-instagram-square"></i></div>
                <div class="text">{{ $skill->pivot->link }}</div>
            </div>
        </li>
    @endif
    @if ($social->social_id == 5)
        <li>
            <div class="li_wrap">
                <div class="icon"><i class="fab fa-telegram"></i></div>
                <div class="text">{{ $skill->pivot->link }}</div>
            </div>
        </li>
    @endif
@endforeach

User.php

public function socials()
{
    return $this->belongsToMany(Social::class)->withPivot('link');
}
Activity icon

Replied to How To Show Image In Stprage?

@snapey

How to show an image?

Activity icon

Replied to How To Show Image In Stprage?

@snapey

Yes, It is saving in ddatabase

Activity icon

Replied to How To Show Image In Stprage?

filesystem.php

'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    's3' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
        'bucket' => env('AWS_BUCKET'),
        'url' => env('AWS_URL'),
    ],

],
Activity icon

Replied to How To Show Image In Stprage?

@automica

What is the solution?

Activity icon

Started a new Conversation How To Show Image In Stprage?

I stored my file like this.

public function update(Request $request)
{
   $user = auth()->user();
   $path = null;
   if ($request->hasFile('image'))
   {
        $file = $request->file('image');
        $nane = time();
        $extension = $file->getClientOriginalExtension();
        $fileName = $nane . '.' . $extension;
        $path = $file->storeAs('images/users', $fileName, 'public');
    }
    $user->image = $path;
    $user->save();
    return redirect()->back();
  }

I want to show an image but it did not show.

<img src="{{ asset('storage/') . auth()->user()->image }}" id="dialog" class="img-fluid rounded-circle cursor-pointer">

I did run.

php artisan storage:link

But I see this demo.

no picture

Oct
18
2 days ago
Activity icon

Started a new Conversation Installation Failed, Reverting ./composer.json To Its Original Content.

I wanna connect my Laravel project to niklasravnsborg /laravel-pdf.

When I run this command:

composer require niklasravnsborg/laravel-pdf

Then I got an error:

Installation failed, reverting ./composer.json to its original content.

My Laravel version is: 7.24 && My PHP version is: 7.4

Oct
17
3 days ago
Activity icon

Replied to How To Update And Insert With FirstOrNew?

@jlrdw

For example, what codes?

Activity icon

Replied to How To Update And Insert With FirstOrNew?

Well, I want to add, maybe the user will add ten Educational.

Activity icon

Started a new Conversation How To Update And Insert With FirstOrNew?

My form is like this demo.

form

When I click Add other academic record, it add new row, and when I'm filling new data And in the last step, when I click on the submit, nothing happens in the database.

foreach ($request->field as $key => $value) {
    $educational = Educational::firstOrNew(['user_id' => auth()->id()]);
    $educational->user_id = auth()->id();
    $educational->grade_id = $request->grade_id[$key];
    $educational->field = $request->field[$key];
    $educational->institution_id = $request->institution_id[$key];
    $educational->branch = $request->branch[$key];
    $educational->institution_education = $request->institution_education[$key];
    $educational->gpa = $request->gpa[$key];
    $educational->nation_id = $request->nation_id[$key];
    $educational->province_id = $request->province_id[$key];
    $educational->town_id = $request->town_id[$key];
    $educational->province_name = $request->province_name[$key];
    $educational->town_name = $request->town_name[$key];
    $educational->entrance = $request->entrance[$key];
    $educational->graduate = $request->graduate[$key];
    $educational->currently_studying = $request->has("currently_studying.$key");
    $educational->save();
}
Oct
14
6 days ago
Activity icon

Replied to PHP Startup: Unable To Load Dynamic Library

I enabled this line. Is it correct?

Dynamic Extensions ;
Activity icon

Replied to PHP Startup: Unable To Load Dynamic Library

Tell me the solution.

Activity icon

Replied to PHP Startup: Unable To Load Dynamic Library

No, I didn't do any of them.

How is it?

Activity icon

Started a new Conversation PHP Startup: Unable To Load Dynamic Library

What is this error?

error

my laravel is 5.8

And my php is PHP Version 7.4.10

Oct
13
1 week ago
Activity icon

Replied to How To Show Socials Network?

Any help you can give would be appreciated.

Activity icon

Replied to Fortify And Bootstrap

@prido

I think yes, You can use them.

Good Luck

Activity icon

Started a new Conversation How To Show Socials Network?

Look at my codes,

show.blade.php

<tr>
    <td>Social network</td>
    <td><a href="{{ route('users.socials',$user->id) }}">More Info</a></td>
</tr>

web.blade.php

Route::get('/users/socials/{user}', '[email protected]')->name('users.socials');

public function socials(User $user)
{
    return view('Admin.users.socials', compact('user'));
}

socials.blade.php

<div class="p-5">
    <h3><i class="fas fa-tachometer-alt ml-2"></i>user: {{ $user->first_name }} {{ $user->last_name }}</h3><hr>
    <div class="table-responsive">
        <table class="table table-bordered table-striped">
            @foreach($user->socials as $social)
                @php
                dd($social->pivot->link)
                @endphp
            @endforeach
        </table>
    </div>
</div>

It show blank

Activity icon

Replied to How To Set Utd-8 In Dompdf

@sinnbeck

Yes, I mean utf-8.

Activity icon

Replied to How To Set Utd-8 In Dompdf

How to set utd-8 in dompdf

Activity icon

Started a new Conversation How To Set Utd-8 In Dompdf

I installed dompdf but it for Persian language not working.

ArtileController

    public function pdf()
{
	$articles = Article::all();
	$pdf = PDF::loadView('articles', compact('articles'));
	return $pdf->download('articles.pdf');
}

articles.blade.php

<!doctype html>
<html lang="fa" dir="rtl">
<head>
    <!-- Required meta tags -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
    <title>Test</title>
    <style>

    </style>
</head>
<body>
    @foreach($articles as $article)
        <h1>{{ $article->title }}</h1>
        <p>{{ $article->body }}</p>
        <hr>
    @endforeach
</body>
</html>

I see this demo

pdf

Activity icon

Replied to FirstOrNew Did Not Add In Database

@munazzil

When I click Add other academic record, it add new row, and when I'm filling new data And in the last step, when I click on the submit, nothing happens in the database.

Oct
12
1 week ago
Activity icon

Replied to FirstOrNew Did Not Add In Database

@bugsysha

I see this demo

datavase

It is blank

Activity icon

Replied to FirstOrNew Did Not Add In Database

@bugsysha

I replaced like this code

    foreach ($request->field as $key => $value) {
        Educational::firstOrCreate([
            'user_id' => auth()->id(),
            'grade_id' => $request->grade_id[$key],
            'field' => $request->field[$key],
            'institution_id' => $request->institution_id[$key],
            'branch' => $request->branch[$key],
            'institution_education' => $request->institution_education[$key],
            'gpa' => $request->gpa[$key],
            'nation_id' => $request->nation_id[$key],
            'province_id' => $request->province_id[$key],
            'town_id' => $request->town_id[$key],
            'province_name' => $request->province_name[$key],
            'town_name' => $request->town_name[$key],
            'entrance' => $request->entrance[$key],
            'graduate' => $request->graduate[$key],
            'currently_studying' => $request->has("currently_studying.$key"),
        ]);
    }

It add a new row like this demo

datavase

It is blank

Activity icon

Replied to FirstOrNew Did Not Add In Database

@bugsysha

What should I do to update if it exists and create it if it does not exist?

    if ($user->where('user_id', auth()->id())) {
        $educational = $user->findOrFail('user_id');
    } else {
        $educational = new Educational;
    }

This code not working...

Activity icon

Replied to FirstOrNew Did Not Add In Database

I tested ten times but nothing happened

Activity icon

Replied to FirstOrNew Did Not Add In Database

Can you send complete code?

Activity icon

Replied to FirstOrNew Did Not Add In Database

@bugsysha

I added code like this, but nothing happens

foreach ($request->field as $key => $value) {
    try {
        $educational = Educational::firstOrNew(['user_id' => auth()->id()]);
        $educational->user_id = auth()->id();
        $educational->grade_id = $request->grade_id[$key];
        $educational->field = $request->field[$key];
        $educational->institution_id = $request->institution_id[$key];
        $educational->branch = $request->branch[$key];
        $educational->institution_education = $request->institution_education[$key];
        $educational->gpa = $request->gpa[$key];
        $educational->nation_id = $request->nation_id[$key];
        $educational->province_id = $request->province_id[$key];
        $educational->town_id = $request->town_id[$key];
        $educational->province_name = $request->province_name[$key];
        $educational->town_name = $request->town_name[$key];
        $educational->entrance = $request->entrance[$key];
        $educational->graduate = $request->graduate[$key];
        $educational->currently_studying = $request->has("currently_studying.$key");
        $educational->save();
    } catch (Exception $e) {
        dd($e->getMessage());
    }
}
Activity icon

Started a new Conversation FirstOrNew Did Not Add In Database

My form is like this demo.

form

When I click Add other academic record, it add new row, and when I'm filling new data And in the last step, when I click on the submit, nothing happens in the database.

foreach ($request->field as $key => $value) {
    $educational = Educational::firstOrNew(['user_id' => auth()->id()]);
    $educational->user_id = auth()->id();
    $educational->grade_id = $request->grade_id[$key];
    $educational->field = $request->field[$key];
    $educational->institution_id = $request->institution_id[$key];
    $educational->branch = $request->branch[$key];
    $educational->institution_education = $request->institution_education[$key];
    $educational->gpa = $request->gpa[$key];
    $educational->nation_id = $request->nation_id[$key];
    $educational->province_id = $request->province_id[$key];
    $educational->town_id = $request->town_id[$key];
    $educational->province_name = $request->province_name[$key];
    $educational->town_name = $request->town_name[$key];
    $educational->entrance = $request->entrance[$key];
    $educational->graduate = $request->graduate[$key];
    $educational->currently_studying = $request->has("currently_studying.$key");
    $educational->save();
}
Activity icon

Started a new Conversation How To Add Language

Look at my codes

resumes

table

public function up()
{
    Schema::create('languages', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('name');
        $table->timestamps();
    });

    Schema::create('language_user', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->bigInteger('language_id')->unsigned()->nullable();
        $table->foreign('language_id')->references('id')->on('languages')->onDelete('cascade');
        $table->bigInteger('user_id')->unsigned()->nullable();
        $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        $table->unique(['language_id', 'user_id']);
        $table->integer('reading_skill')->nullable();
        $table->integer('writing_skill')->nullable();
        $table->integer('listening_skill')->nullable();
        $table->timestamps();
    });
}

Controller

foreach($request->language_id as $key => $language_id){
    $user->languages()->attach($language_id, [
        'user_id' => auth()->id(),
        'reading_skill' => $request->reading_skill[$key],
        'writing_skill' => $request->writing_skill[$key],
        'listening_skill' => $request->listening_skill[$key],
    ]);
}

I get this error

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-2' for key 'language_user_language_id_user_id_unique' (SQL: insert into language_user (language_id, listening_skill, reading_skill, user_id, writing_skill) values (2, 2, 4, 2, 3))

Activity icon

Started a new Conversation Uncaught Error: Syntax Error, Unrecognized Expression: Select#state_id Option[value=]

I have a datalist which looks like this

<select id="country_id" name="country_id" class="form-control">
    <option></option>
    @foreach($countries as $country)
        <option {{ optional(auth()->user()->country)->id == $country->id ? 'selected' : '' }} value="{{ $country->id }}">
            {{ $country->name }}
        </option>
    @endforeach
</select>

Now I'm using this code to find where values entered by the user is in the list:

I get this error in console.

error

How to get rid of this error?

Activity icon

Replied to How To Find User_id When Update

@sinnbeck

Oh I was not paying attention

error

Activity icon

Replied to How To Find User_id When Update

😔😔😔

Activity icon

Replied to How To Find User_id When Update

@michaloravec

Ok, I will subscription later . I'm just in a hurry right now, answer my question.

Activity icon

Replied to How To Find User_id When Update

@sinnbeck

Is it correct ?

foreach ($request->field as $key => $value) {
    $educational = Educational::where('user_id', auth()->id())->firstOrNew();
    $educational->user_id = auth()->id();
    $educational->grade_id = $request->grade_id[$key];
Activity icon

Replied to How To Find User_id When Update

@rodrigo.pedra

thanks for send

but if send @michaloravec film it well

Activity icon

Replied to How To Find User_id When Update

@michaloravec

I don't have $15 for a month subscription.

Activity icon

Replied to How To Find User_id When Update

@sinnbeck

I get this error.

error

Activity icon

Replied to How To Find User_id When Update

@rodrigo.pedra

Can you send free film of free @michaloravec

Activity icon

Replied to How To Find User_id When Update

@sinnbeck

I replaced it. Is it correct now???

if (auth()->check()) {
    $educational = Educational::where('user_id', auth()->id())->first();
} else {
    $educational = new Educational;
}
Activity icon

Replied to How To Find User_id When Update

@michaloravec

Okay, I'm just in a hurry right now, answer my question.

Activity icon

Replied to How To Find User_id When Update

@sinnbeck

Yes. How should I do?