Edgy

Edgy

Rome

Member Since 11 Months Ago

Experience Points 1,480
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Answer
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.

18 Jan
9 months ago

Edgy started a new conversation Edit/update With Relationship

Hi folks, I have a serious problem in my thesis, Here are my problems in relationships: I have 2 tables, workers which is the list of users, and workers_skills which are set of skills connected to workers. under workers_skills it has 2 columns, workers_id and workers_skills Example:

// `workers_skills`
workers_id  |   skills
1   masonry
1   barista
1   cuoco
2   lavapiatti

// `workers`
id  |   name
1   Giuseppe Amarino
2   Marco   Centrale

It will look for an id in workers then after update, it will automatically change the value in workers_skills. example, I will edit the masonry and change it to waiter, it will find the id which is 1 from workers and it will edit/update it in workers_skills who have 1 in their workers_id and change the masonry to waiter. is this possible?

//This is a controller
    public function edit($id)
    {
        $edit_profile = Worker::find($id);
        return view('worker.profile.edit',compact('edit_profile'));
    }

 
    public function update(Request $request, $id)
    {
        request()->validate([
       
        ]);
        WorkerSkills::find($id)->update($request->all());
        return redirect()->route('worker.jobs.index')
                        ->with('success','Article updated successfully');
    }
04 Jan
10 months ago

Edgy left a reply on How Do I Prevent Looping The Title Tag?

@martinbean Hi, you mean this?

//QualcosaController.php
$workers_skills = WorkersSkill::where('workers_id', Auth::user()->id)->get();

Edgy left a reply on How Do I Prevent Looping The Title Tag?

2 columns workers_expertise and workers_skill_role workers_skill_role is more likely the category and workers_expertise is the list of skills

Edgy left a reply on How Do I Prevent Looping The Title Tag?

Hi @martinbean

I have lots of column like seo, web development and etc. so if the table exist with seo it will loop the data together with the h2 tag. If I put the title tag outside forloops, it will become static.

Edgy started a new conversation How Do I Prevent Looping The Title Tag?

Hi, how do I prevent the looping of the <h2> SEO </h2> ?

@foreach ($workers_skills as $workers_skill)

    @switch($workers_skill->workers_skill_role)
        @case('seo')
            // this one <h2>SEO</h2>
            
        {{$workers_skill->workers_expertise}}
            
            @switch($workers_skill->skill_level)
            @case('1')
            <i style="color: yellow" class="fa fa-star" aria-hidden="true"></i>
            <i style="color: #fafafa" class="fa fa-star" aria-hidden="true"></i>
            <i style="color: #fafafa" class="fa fa-star" aria-hidden="true"></i>
            @break
            @case('2')
            <i style="color: yellow" class="fa fa-star" aria-hidden="true"></i>
            <i style="color: yellow" class="fa fa-star" aria-hidden="true"></i>
            <i style="color: #fafafa" class="fa fa-star" aria-hidden="true"></i>
            @break
            @case('3')
            <i style="color: yellow" class="fa fa-star" aria-hidden="true"></i>
            <i style="color: yellow" class="fa fa-star" aria-hidden="true"></i>
            <i style="color: yellow" class="fa fa-star" aria-hidden="true"></i>
            @break
            @endswitch
        <br>
        @break

Thank you

Edgy left a reply on Adding Where Clause In Blade

Hi @tisuchi, I am near to finish the functionality but I have some question:

is also included in loop, how do I exempt or not include the `

Title Tag` in for loop? and my 2nd question is, for example, the `SEO` in table is doesn't exist, it will also hide the `

tag` is this possibe?
@foreach ($workers_skills as $workers_skill)

     @if($workers_skill->workers_skill_role === 'SEO')
        <h2> SEO </h2>
            {{$workers_skill->workers_expertise}}<br>
     @endif 

        @if($workers_skill->workers_skill_role === 'Writing')
        <h2> Writing </h2>
            {{$workers_skill->workers_expertise}}<br>
        @endif 

@endforeach 

//This is Output
// <h2> SEO
// offpage
// <h2> SEO
// onpage

Thank you for your help

Edgy left a reply on Adding Where Clause In Blade

Hi @topvillas

Thank you, could you help me how do I convert these codes or example? I couldn't understand well the documentations.

Thank you

03 Jan
10 months ago

Edgy started a new conversation Adding Where Clause In Blade

Hi guys, is there any way to add where clause in blade template in foreach loop? I don't think putting multiple eloquent in controller is a good idea so I assume if this is possible, like this:

<h1> work expertise </h1>
@foreach ($workers_skills as $workers_skill)
        {{$workers_skill->workers_expertise->where('skills', 'seo') }}
@endforeach 

@foreach ($workers_skills as $workers_skill)
        {{$workers_skill->workers_expertise->where('skills, 'web') }}
@endforeach

Thanks

02 Jan
10 months ago

Edgy left a reply on How Do I Get The Latest Data Using GroupBy?

Fixed

->orderBy('id', 'desc')
->get()
->unique('workers_thesis_id');

Edgy left a reply on How Do I Get The Latest Data Using GroupBy?

Hi @sheldonscott

Thank you, but I dont get any errors in my groupby. the latest data or id is not showing, only the first data.

thanks.

Edgy started a new conversation How Do I Get The Latest Data Using GroupBy?

how do I order the query and get the latest result? I always get the first data in SQL.

$workers_messages = InboxMailThesis::where('workers_id', Auth::user()->id)
->groupBy('workers_thesis_id')
->orderBy('id', 'desc')
//->orderBy('id', 'asc')
//->latest()
->paginate(5);


Thanks

Edgy left a reply on Relationship: Property [inbox_message] Does Not Exist On This Collection Instance.

Hi,

I tried to change the blade to {{ $workers_message->inboxmail }} I tried the above codes but it doesnt work well.

and in relationship mode, I add the hasMany with ->take(1). but then the view returns array, is there any way to fix this?

Thanks

31 Dec
10 months ago

Edgy left a reply on Relationship: Property [inbox_message] Does Not Exist On This Collection Instance.

Hi @Snapey ,

I think I figure the problems, but can't figure out how to fix this. It's looks like I have many inbox_messages so Is there any way to add 'WHERE' clause in view?

Thanks

Edgy started a new conversation Relationship: Property [inbox_message] Does Not Exist On This Collection Instance.

Hi guys, I have an error Property [inbox_message] does not exist on this collection instance. So basically, the workers_applications.id must be the same to all of my inbox_mails.workers_applications_id. So in table workers_applications there's only 1 applicant while in inbox_mails there's more than 2. any help guys? thanks.

//InboxMail.php (Model)

 public function workerapplicationinbox(){
        return $this->belongsTo('App\WorkersApplication', 'workers_applications_id', 'id' );
    }
//WorkersApplication.php (Model)

public function inboxmail(){
        return $this->hasMany('App\InboxMail', 'id', 'workers_applications_id');
    }
//view
{{$workers_message->inboxmail->inbox_message}}
30 Dec
10 months ago

Edgy left a reply on How Do I Prevent Other Auth::user To See The Inbox?

Fixed, kindly delete this thread. Thanks

Edgy started a new conversation How Do I Prevent Other Auth::user To See The Inbox?

HI guys, how do I prevent other Auth::users from showing the data in show() ? example: /public/inbox/41 and other user can randomly change the number from 41 to /public/inbox/42 and they can see the messages?

here are my codes:

 $workers_messages = WorkersApplicationThesis::where('workers_id', Auth::user()->id)
        ->where('workers_applications_id', $id)
        ->find($id);
        
        $inbox_messages = InboxMailThesis::all()
        ->where('workers_id', Auth::user()->id)
        ->where('workers_applications_id', $id)
        ->sortByDesc('id');

Edgy left a reply on Hesto MultiAuth - How To Get User() In Different Auth?

Hi @king_eke

thank you, I will try to figure out and apply in my thesis app.

29 Dec
10 months ago

Edgy started a new conversation Hesto MultiAuth - How To Get User() In Different Auth?

Hi guys,

I am using Hesto Multi Auth for my thesis, I have 2 Auth accounts, jobseeker and jobemployer, so the link will be public/jobseeker/ and public/jobemployer/. Here is my main problem. In guest page public/index/ I don't have any auth because the auth is in /jobemployer/ or /jobseeker/ how do I get the auth from different tables like jobseeker and jobemployer?

Thanks

23 Dec
10 months ago

Edgy left a reply on Cache Buster Or Versioning Not Working

Fixed

<link rel="stylesheet" href="{{ asset(mix('/css/app.css')) }}">

Edgy left a reply on Cache Buster Or Versioning Not Working

@Yama

I found the culprit, the link directs to /css/app.css instead of http://localhost:8888/thesis/public/css/app.css is there any fix on this? tried to change the link but I always got an error

Edgy left a reply on Cache Buster Or Versioning Not Working

Hi @Yama

you mean like this?

mix.js('resources/assets/js/app.js', 'public/js');

if (mix.inProduction()) {
    mix.version();
}

Edgy started a new conversation Cache Buster Or Versioning Not Working

Mix Laravel cache buster not working, how can I fix this? I also changed the rel link from asset to mix and the .css files are not generating random numbers like (app.css1312321432535).

Thanks

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');
   .version();
20 Dec
10 months ago

Edgy left a reply on How Do You Create A Search Functionality In Laravel?

@topvillas

Hi, but using LIKE is secured and safe? I only use 1 function or 1 search only. Do you think do I need Scout for simple function? What is your suggestions?

Thanks

Edgy started a new conversation How Do You Create A Search Functionality In Laravel?

Hi,

I am new to laravel and I want some feedback from professional developers in Laracast. How do you usually create a search from Database? i'm using Eloquent and when I search it in Google, it has 2 options. 1st is the typical search.blade.php and the 2nd is somewhat called Laravel Scout or Algolia. I am confused on these 2 options. Which of these you usually do and why?

Thanks for information.

19 Dec
10 months ago

Edgy left a reply on Conflicting Of Route, How To Fix This?

I cant believe on myself that I missed that type. Thanks mate

Edgy started a new conversation Conflicting Of Route, How To Fix This?

I have a conflicting route, how can I fix this? I figure out the problem is in create.blade.php

Thanks.

Route::prefix('/')->middleware('employer')->group(function () {
    Route::get   ('jobs/create','[email protected]')->name('jobs.create');
    Route::get   ('jobs/create','[email protected]')->name('inbox.create');

16 Dec
10 months ago

Edgy started a new conversation Simple Paginate Not Working

Hi guys, I have an error where method not exist.

$workers_test = WorkersTest::all()
        ->where('workers_id', Auth::user()->id)
        ->sortByDesc('id')
        ->simplePaginate(5);
        return view('worker.inbox.index', compact('workers_test'));

Is there any way to fix this? thanks

Edgy left a reply on How To Insert To Database Including Break Spaces Or Break Line?

I Figure out

{{ !! nl2br(e($content)) !! }}

Edgy started a new conversation How To Insert To Database Including Break Spaces Or Break Line?

Hi guys, how do I input it to database? Everytime I store to database, break line doesn't include:

//This is the problem
1. Test 1 2. Test 2 3. Test 3

I want to insert like this

1. Test 1
2. Test 2
3. Test 3

Any tips?t Here are my codes:

{!! Form::text('test-area', null, array('placeholder' => 'Thesis Name','class' => 'form-control')) !!}
ThesisTest::create([

        'test-area' => $request->test-area,
]);

Thanks

Edgy left a reply on Passing Variables To Multiple Views

I am not sure if this is my best practise, but I put the

public function show($id)
    {   
$inbox_test = InboxMail::all()
}

to show controller

Edgy started a new conversation Passing Variables To Multiple Views

Hi guys, I need some help and I am confused right now. How do I pass the variable from Controller to different views like index.blade.php and show.blade.php ? Here is the code:

public function index()
    {
    $workers_test = WorkersApplication::all()
        ->where('employers_id', Auth::user()->id)
        ->sortByDesc('id');

            $inbox_test = InboxMail::all()
        ->where('employers_id', Auth::user()->id)
        ->sortByDesc('id');

return view('employer.inbox.index', compact('workers_messages', 'inbox_messages'));
// in return view, I wanted to pass the variable to `employer.inbox.show` but when I tried to add, I got error
}

Thanks guys

Edgy left a reply on Laravel Query Builder To Eloquent

@tisuchi Thank you, this works

Edgy started a new conversation Laravel Query Builder To Eloquent

Hi guys, I am bit confused in eloquent, is there any way to convert this code to eloquent? Thank you guys.

$thesis_test = WorkersApplication::join('workers', 'workers.id', '=', 'workers_applications.workers_id')
    ->where('employers_id', Auth::user()->id)
    ->orderBy('employers_jobs_id', 'desc')->get();
12 Dec
11 months ago

Edgy started a new conversation Auth User In Query, Is This Also Good Practise?

Hi guys, I have a quick question. is this a good practise?

$test = WorkersTest::where('workers_id', Auth::user()->id)->get();

basically this is a query where is only select based on their login auth::user is this a good practise?

Thank you

28 Nov
11 months ago

Edgy started a new conversation Eloquent Relationship Or Query Builder For 3 Relational Tables?

Hi guys, I have 3 tables namely, workers_messages jobs and employers under workers_message have jobs_id jobs have employers_id

I am creating like a inbox page, so I am the employer and I will get the records from workers_message. The relation is simple: workers_message.jobs_id -> jobs.employers_id -> employers

My question is, it is recommended to code this with Eloquent:Relationship? or Query Builder? I will expect to receive like 100 messages per jobs, which are recommended? Thanks

27 Nov
11 months ago

Edgy left a reply on How Can I Store The ID Of The Row Automatically?

Thank you @Stratos

I include the form.blade to show.blade and works.. Thank you so much

Edgy left a reply on How Can I Store The ID Of The Row Automatically?

Hi @Stratos

could you help me how to pass to multiple views? Thanks

 public function show($id)
    {
        $jobs = EmployersJobs::findOrFail($id);
        return view('employer.jobs.show',compact('jobs'));
      //  return view('employer.jobs.show', 'employer.jobs.form', compact('jobs'));
    }

Edgy left a reply on How Can I Store The ID Of The Row Automatically?

Hi @Stratos

could you help me how to pass to multiple views? Thanks

 public function show($id)
    {
        $jobs = EmployersJobs::findOrFail($id);
        return view('employer.jobs.show',compact('jobs'));
      //  return view('employer.jobs.show', 'employer.jobs.form', compact('jobs'));
    }

Edgy left a reply on How Can I Store The ID Of The Row Automatically?

HI @Stratos

I am using e Collective Form in view. I tried to put the <input type="hidden" value="{{ $jobs->id }}" name="job_id"> and shows error undefined variable is there any alternative for this? Thanks

 <strong>Cover Title:</strong>
            {!! Form::text('workers_cover_title', null, array('placeholder' => 'Cover Title','class' => 'form-control')) !!}
        </div>
        <strong>Cover Letter:</strong>
            {!! Form::textarea('workers_message', null, array('placeholder' => 'Cover Letter','class' => 'form-control')) !!}


             <strong>Expected Salary:</strong>
            {!! Form::text('workers_expected_salary', null, array('placeholder' => 'Expected Salary','class' => 'form-control')) !!}

Edgy left a reply on How Can I Store The ID Of The Row Automatically?

Hi @martinbean

the ID of the employers_jobs. I updated my question because of lack of information

Edgy started a new conversation How Can I Store The ID Of The Row Automatically?

Hi Guys, how can I add the id of the row automatically? Thanks

public function index()
    {
        $jobs = EmployersJobs::latest()->paginate(5);
        return view('worker.jobs.index',compact('jobs'))
            ->with('i', (request()->input('page', 1) - 1) * 5);
    }

public function store(Request $request)
    {
 
        request()->validate([

            // 'workers_message' => 'required',
        ]);
        

        WorkersApplication::create([

        'workers_message' => $request->workers_message,
        'workers_cover_title' => $request->workers_cover_title,
        'workers_expected_salary' => $request->workers_expected_salary,
        'workers_id' => Auth::user()->id,
    //'employers_job_id' => $job->id,
        

        ]);

        return redirect()->route('worker.jobs.index')
                        ->with('success',' Thesis Test was created successfully');
    }
25 Nov
11 months ago

Edgy left a reply on Query Builder To Eloquent Relationship

Hi @tykus

I am thinking about that code because its easy to read and updated, and I will try to add paginate(10) because paginate in query builder is not working.

maybe I will try to learn the eager load.

Thanks

Edgy started a new conversation Query Builder To Eloquent

Hi guys, is this possible inner join to convert this into Eloquent? Thanks

  $jobs = DB::table('employers')
        ->join('employers_jobs', 'employer_id', '=', 'employers.id')
        ->get();
18 Nov
11 months ago

Edgy left a reply on Relationship : Lots Of ID From Database

@shez1983

Hi, I want to show in the index where you see the list of jobs and see the list of who are the employer. example:

| employer_id | Summary | | 1 | Summary 1 | | 2 | Summary2 |

then it will show like this

|Employer name | Summary | | Edgy | Summary 1 | | Micho | Summary2 |

Edgy started a new conversation Relationship : Lots Of ID From Database

Hi guys,

I am looking ways to dynamically fetch on ID from many relationships. My Main problem is how do I replace the find() dynamically? `$employerJobs = Employer::find(1)->EmployersJobs;/

// EmployersJobController

public function index()
    {
        $jobs = EmployersJobs::orderBy('id','desc')->paginate(10);
    $employerJobs = Employer::find(1)->EmployersJobs; // How can I dynamically replace the find()?;
    return view('employer.jobs.index',compact('jobs', 'employerJobs', 'employer'))
            ->with('i', (request()->input('page', 1) - 1) * 5);
    }
// EmployersJobs Model
public function Employer(){

        // return $this->belongsTo(Employer::class);
    return $this->hasMany(Employer::class,'id');
    }
// Employer Model
 public function EmployersJobs(){

        // return $this->hasMany(EmployersJobs::class);
       return $this->hasMany(EmployersJobs::class,'employer_id');
    }
// View
@foreach ($jobs as $job)
<td>{{$employerJob->employers_name}}</td>

Edgy left a reply on How Do I Insert My Auth::user Together With Form, In A Single Row

Hi @Snapey

Thank you very much, it works now.

I have future plans for it and I just wanted to test it, I might use join or they called 'relationship' like inserting the user_id and match it from users. I am not sure if this is the best practice.

Cheers

Edgy started a new conversation How Do I Insert My Auth::user Together With Form, In A Single Row

After I hit the submit buttom from my form, It always insert into 2 rows. is there any way to insert the auth::user in a same row with form?

Here is the error, example:

id  | name   | description |
1    | Edgy     |                      |
2   |                |   Edgy Description |    
// controller
public function store(Request $request)
    {
 
        request()->validate([
            // 'employers_name' => 'required',
            'employers_job_title' => 'required',
            'employers_job_summary' => 'required',
        ]);
        
        EmployersJobs::create($request->all());
        $test_name = new EmployersJobs;
        $test_name->employers_name = Auth::user()->name;
        $test_name->save();
        return redirect()->route('employer.jobs.index')
                        ->with('success','Article created successfully');
    }
// form.blade.php

<div class="row">
    <div class="col-xs-12 col-sm-12 col-md-12">
        <div class="form-group">

          <!--   <strong>Employers Name:</strong>
            {!! Form::text('employers_name', null, array('placeholder' => 'Employers Name','class' => 'form-control')) !!}
        </div> -->

    </div>
    <div class="col-xs-12 col-sm-12 col-md-12">
        <div class="form-group">
            <strong>Job Title:</strong>
            {!! Form::text('employers_job_title', null, array('placeholder' => 'Job Title','class' => 'form-control')) !!}
        </div>
        <strong>Job Summary:</strong>
            {!! Form::textarea('employers_job_summary', null, array('placeholder' => 'Job Summary','class' => 'form-control')) !!}


             <strong>Salary:</strong>
            {!! Form::text('employers_job_salary', null, array('placeholder' => 'Salary','class' => 'form-control')) !!}

             <strong>Location:</strong>
            {!! Form::text('employers_job_location', null, array('placeholder' => 'Location','class' => 'form-control')) !!}
    </div>

   <div class="col-xs-12 col-sm-12 col-md-12 text-center">
            <button type="submit" class="btn btn-primary">Submit</button>
    </div>
</div>