mimiloca

mimiloca

Member Since 1 Week Ago

Experience Points
370
Total
Experience

4,630 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
370 XP
Sep
17
1 week ago
Activity icon

Started a new Conversation Updating Normal User To Admin

I want to update normal user to admin.

this is what i have tried Im not getting any error but the data is not updated to0

    public function add(User $users, Request $request)
    {
        
        if($users->is_admin == '0')
        {
            $users->update(['is_admin'=> '1']);
        }
        
        $users->save();
       
        return redirect('admin.users')->with('success', 'Admin Added!');
    }


<div class="form-group row">
                    <label for="ic" class="col-sm-2 col-form-label">Is Admin</label>
                    <div class="col-sm-10">
                        <input type="number" class="form-control" name="is_admin" value="{{$users->is_admin}}" >
                    </div>
                  </div>

Sep
16
1 week ago
Activity icon

Started a new Conversation How To Make Image Center ?

given this code

 <img class="img-fluid pad" text-align: center; display: block;  src="/storage/event_images/{{$event->event_image}}" width="250" height="124" > 
Activity icon

Started a new Conversation How To Make Query For Fetching Specific Id In Eloquent Many To Many?

I'm trying to access a specific club id and displaying all the members under the same club id. This function is for admin page.

Below is the code that I have tried but it fetching all the user including the non members. How can I fix this query?


    club                member                     club_member 
id |     name   |     |id  |  name |        | id| id_club | id_member|
---|------------|     |----| ------|        |-------------------------
1  | Sc Club    |     | 1  | Maria |        | 1 |    1    |    1     |
2  | Mimes Club |     | 2  | Julia |        | 2 |    1    |    3     |
                      | 3  | Danny |        | 3 |    2    |    1     |
                      | 4  | Olie  |        | 4 |    2    |    2     |
                                            | 5 |    1    |    4     |



I'm trying to access the club id_2 and displaying the user under club id=2 which is Maria and Julia

public function show()
    {
        $clubs = Club::with('members')->get();
        return view('club.member')->with('club', $clubs); 
    }
Activity icon

Replied to How Do I Pass User_id For Updating Perpose In Admin Page?

nevermind i just put the $application Your method works! Thank you took me several hours to find this out! Thank you again.

Activity icon

Replied to How Do I Pass User_id For Updating Perpose In Admin Page?

public function update(Application application, Request $request) 

This give me error with syntax error, unexpected 'application' (T_STRING), expecting variable (T_VARIABLE) ';' expected.php Unexpected ','

Activity icon

Replied to Displaying List Of Users That Belongs To 1 Particular Event [Admin Page]

it shows all the the users. My query is wrong then .-. i was thinking it was correct. silly me

Activity icon

Replied to Displaying List Of Users That Belongs To 1 Particular Event [Admin Page]

it showing all the user inside this event (including the non-members) how do i fix this?

Activity icon

Started a new Conversation Displaying List Of Users That Belongs To 1 Particular Event [Admin Page]

I'm trying to display a list of user that belongs to 1 particular event in the admin page. This is many to many relationship. I'm trying to display the user name, and phone number inside the particular event page.

  1. I got error with Property [user] does not exist on this collection instance.

  2. How do I fix this to be able to view the list of user

  public function show()
    {
        $events = Event::with('users')->get();
        return view('admin.event.user')->with('events', $events); 
    }


 @foreach ($events->user as $user)
                                   
  <tr>
        <td>{{$loop->index +1 }}</td>
        <td>{{$user->name}}</td>
        <td>{{$user->phone}}</td>
    </tr> 
                                    
                                  @endforeach

Activity icon

Started a new Conversation How To Get 4 Latest Data To Be Shown In List Page?

I want to view the 4 latest data inside my view page.

 public function index()
    {
        $event = DB::select('SELECT * FROM events');
        return view('home')->with('event', $event);
    }
Activity icon

Replied to How Do I Pass User_id For Updating Perpose In Admin Page?

I already have {$id} in my edit route

Route::get('/application/edit{id}', '[email protected]')->name('application.edit')->middleware('is_admin');

but $id is belongs to id of the application.

Activity icon

Replied to How Do I Pass User_id For Updating Perpose In Admin Page?

i get Undefined variable: user_id in this line return view('application.edit')->with('application', $applications)->with('user_id', $user_id);

Activity icon

Started a new Conversation How Do I Pass User_id For Updating Perpose In Admin Page?

i'm creating update method to update user application status. This is in 1- M relationship. but I'm getting error with General error: 1364 Field 'user_id' doesn't have a default value

then i realized that i dont pass the user value so i want to put this method $application->user_id = $request->input('user_id') ; How to put that method or pass the user_id ? So admin can update the user application status.

edit.blade

<form class="form-horizontal" action="{{route('application.update')}}" method="POST" >
 public function edit($id)
    {
        
        $applications = Application::with('user')->find($id);

        return view('application.edit')->with('application', $applications);
    }


  public function update(Request $request)
    {
        $this->validate($request,[

            'status' =>'required',
        ]);

        $applications = new Application;
        $applications->status = $request->input('status');
        $applications->save();
       
        return redirect('/application/view')->with('Success', 'Status updated!');
    }