alexxa

alexxa

Member Since 3 Months Ago

Experience Points
1,000
Total
Experience

4,000 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
9
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
1,000 XP
Apr
12
3 months ago
Activity icon

Replied to Missing Required Parameters For [Route: Admin.edit] [URI: Admin/edit/{id}].

I solved the problem. I redirected it to the wrong route. I must have written it like this with admin.index:

 Route::post('edit', function(Illuminate\Http\Request $request)  {
        return redirect()
        ->route('admin.index') 
        ->with ('info', 'Post edited. New title ' . $request -> input('title'));
    })->name('admin.update');

Thank you very much for your patience !:) And hope I didn't mind you with my noob questions

Activity icon

Replied to Missing Required Parameters For [Route: Admin.edit] [URI: Admin/edit/{id}].

yes, and now I get this error:

Missing required parameters for [Route: admin.update] [URI: admin/edit/{id}]. (View: C:\laragon\www\laravelBasics\resources\views\admin\edit.blade.php)
Activity icon

Replied to Missing Required Parameters For [Route: Admin.edit] [URI: Admin/edit/{id}].

Snapey, it appears when I try to edit a user post. I want to change the title of a post. I was following some Laravel 5 series as I like the way the tutor explains. However, I use Laravel 6 for my project as it is newer. I followed the steps exactly and I simply can't get what I am doing wrong.

Activity icon

Replied to Missing Required Parameters For [Route: Admin.edit] [URI: Admin/edit/{id}].

I tried to clear it and I get an error:

 LogicException  : Unable to prepare route [api/user] for serialization. Uses Closure.

  at C:\laragon\www\laravelBasics\vendor\laravel\framework\src\Illuminate\Routing\Route.php:917
    913|      */
    914|     public function prepareForSerialization()
    915|     {
    916|         if ($this->action['uses'] instanceof Closure) {
  > 917|             throw new LogicException("Unable to prepare route [{$this->uri}] for serialization. Uses Closure.");
    918|         }
    919|
    920|         $this->compileRoute();
    921|

  Exception trace:

  1   Illuminate\Routing\Route::prepareForSerialization()
      C:\laragon\www\laravelBasics\vendor\laravel\framework\src\Illuminate\Foundation\Console\RouteCacheCommand.php:62

  2   Illuminate\Foundation\Console\RouteCacheCommand::handle()
      C:\laragon\www\laravelBasics\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:32

The full error I get on the laravel app is:

Illuminate\Routing\Exceptions\UrlGenerationException
Missing required parameters for [Route: admin.edit] [URI: admin/edit/{id}].
Activity icon

Started a new Conversation Missing Required Parameters For [Route: Admin.edit] [URI: Admin/edit/{id}].

Hi! I have this error in Laravel 6. I am new to Laravel..I actually started a few days ago and I want to edit some user posts and I get this error. Here is my code form index.blade.php

@extends('layouts.admin')

@section('content')
    @if(Session::has('info'))
        <div class="row">
            <div class="col-md-12">
                <p class="alert alert-info">{{ Session::get('info') }}</p>
            </div>
        </div>
    @endif
    <div class="row">
        <div class="col-md-12">
            <a href="{{ route('admin.create') }}" class="btn btn-success">New Post</a>
        </div>
    </div>
    <hr>
    <div class="row">
        <div class="col-md-12">
            <p><strong>Learning Laravel</strong> <a href="{{ route('admin.edit', ['id' => 1]) }}">Edit</a></p>
        </div>
    </div>
@endsection

Here is my code from web.php

<?php

Route::get('/', function () {
    return view('blog.index');
})->name('blog.index');

Route::get('post/{id}', function ($id) {
    if($id==1){
        $post =[
            'title' => 'Learning Laravel',
            'content' => 'This blog post will get you right on track with Laravel'
        ];
    }else{
        $post =[
            'title' => 'Something else',
            'content' => 'Some other content'
        ];
    }
    return view('blog.post', ['post' => $post]);
})->name('blog.post');

Route::get('about', function () {
    return view('other.about');
})->name('other.about');

// here i grouped all the routes with the admin name
// so that if i want to change all the routes with the admin name
//i simple change the prefix, which won't ;ead to any errors

Route::group(['prefix' => 'admin'], function() {
    Route::get('', function () {
        return view('admin.index');
    })->name('admin.index');

    Route::get('create', function () {
        return view('admin.create');
    })->name('admin.create');
    
     //Dependency injection for post request
    Route::post('create', function(Illuminate\Http\Request $request) {
        return "It works!";
    })->name('admin.create');

    Route::get('edit/{id}', function ($id) {
        if($id==1){
            $post =[
                'title' => 'Learning Laravel',
                'content' => 'This blog post will get you right on track with Laravel'
            ];
        }else{
            $post =[
                'title' => 'Something else',
                'content' => 'Some other content'
            ];
        }
        return view('admin.edit', ['post' => $post]);
    })->name('admin.edit');
    //Dependency injection for post request
    Route::post('edit', function(Illuminate\Http\Request $request) {
        return redirect()
        ->route('admin.edit') 
        ->with ('info', 'Post edited. New title ' . $request -> input('title'));
    })->name('admin.update');
});

Thnak you ! :)