littleboby

littleboby

Member Since 7 Months Ago

Experience Points
550
Total
Experience

4,450 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-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
550 XP
Aug
04
5 months ago
Activity icon

Replied to Vue Router Component Needs Reloading In Order To Function Properly

Thanks for the suggestion, do you think it is because regarding to styling I'm not using a single scss or css but inline component styling?! Also in regard to functionality there are no problems, my bad for saying that.

Edit: tried putting all styles into my scss but that doesn't make a difference

Activity icon

Started a new Conversation Vue Router Component Needs Reloading In Order To Function Properly

Hello everyone,

I'm having a bit of an issue with vue router.

Basically I have a parent component and children of children of this component(so a tree of components). So far the basic route functionality/navigation works as expected, but when I use a "back button" to go back to a specific parent component, there are (parent)component elements such as buttons and inputs that do not reload and function properly.

What I mean by that is, a simple input after going back looks like this when clicked inside of: https://imgur.com/a/JzxE1h8 : instead of looking like this: https://imgur.com/a/HSNcgTk.

This simple input field is one of more than 10 examples(inputs, textareas, buttons).

If I want the elements to look how I want(and how it should on click) I have to reload.

Here are two short snippets regarding a parent and its child component:


<div class="mdl-card__actions mdl-card--border"> // just the click
       <router-link v-bind:to="'/group/' + group.id">
             <a class="mdl-button"> View Group </a>
       </router-link>
</div>      

and the back button inside the child that takes us back to the parent:

<button @click="$router.push({path: '/discover'})" class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--colored backbtn">
                Back to Groups
</button>

Now speaking strictly semantically I know I could just write router-link without an anchor tag within but bear with me:

  • Using simple anchor tags with a click event and pushing a path doesn't make a difference, neither does:
  • Using a router-link as a back button

Also I have initiated router-view in my App.vue component.

I hope this snippet is enough to tell me what I missed, otherwise I'd be happy to provide more, your help is appreciated.

Thanks

Aug
01
5 months ago
Activity icon

Replied to Cannot Create New RESTful API Instance

Thanks for the answer, now in my web.php file I replaced the earlier statement with the following:

Route::get('/{any?}', function (){
    return view('discover');
})->where('any', '^(?!api\/)[\/\w\.-]*');

and the store method like so:

public function store(Request $request) {
        $request->validate([
            'title' => 'required|max:30',
            'description' => 'required|max:455',
            'place' => 'required',
            'time_happening' => 'required|date',
        ]);

        $event = Event::createFromArray($request->toArray());

        return response()->json($event)->withHeaders([
            'Content-Type' => 'application/json;charset=UTF-8, Accept:application/json',
        ]);
    }

Telescope shows this:

content-type: "application/json",

and it still doesn't seem to work. Trying this syntax in Insomnia or Postman gives an error saying:

The GET method is not supported for this route. Supported methods: POST.

Could I make the route statement better? What should I make to fix this?

Jul
29
5 months ago
Activity icon

Replied to Cannot Create New RESTful API Instance

@punksolid & @snapey - So in my api.php file I have this route -

Route::post('event/', '[email protected]');

which calls the aforementioned method.

In my Insomnia Client I'm doing the request with the following json body and the following credentials - Body: https://imgur.com/ILgyz2e , Authentication: https://imgur.com/Rf93al3 , Telescope Feedback: https://imgur.com/8uPs1QU - , which I now see uses the SinglePageController and gets me redirected.

This controller looks like this:

class SinglePageController extends Controller {
    public function index() {
        return view('discover');
    }
}

which is the main class for the following route(s):

Route::get('/{any}', '[email protected]')->where('any', '.*');
Jul
28
5 months ago
Activity icon

Replied to Cannot Create New RESTful API Instance

Also: If I open my Telescope panel this request is shown as a GET request and I don't get it

Activity icon

Replied to Cannot Create New RESTful API Instance

Thanks for the answer @punksolid, I just switched from create to store. The Resource::controller('EventController') is in other methods of this controller, if that makes any difference to my situation?

My route for this method looks like this:

Route::post('event/', '[email protected]');

Jul
27
5 months ago
Activity icon

Started a new Conversation Cannot Create New RESTful API Instance

Doing a small CRUD-App and I'm having problems creating an instance, on Api endpoint: 'event/' the Controller named: EventController and Method: create is called.

This is what the method looks like:

public function create(Request $request) {
    $request->validate([
        'title' => 'required|max:30',
        'description' => 'required|max:455',
        'place' => 'required',
        'time_happening' => 'required|date',
    ]);

    $event = Event::createFromArray($request->toArray());

    return response()->json($event);
}

While the model looks like this:

public static function createFromArray($data) {
    // Create a new event with the given data.
    $event = self::create([
        'title' => $data['title'],
        'description' => $data['description'],
        'place' => $data['place'],
        'time_happening' => $data['time_happening'],
        'created_by' => auth()->user()->id,
        'group_id' => $data['group_id']
    ]);


    // Return the newly created event.
    return $event
}

The JSON I'm writing in the API Client:

{
  "title": "Laravel Tech Meetup.Laravel Tech Meetup.Laravel Tech 
    Meetup.Laravel Tech Meetup.",

   "description": "Qui molestiae consectetur ipsam vel 
    dicta. Nesciunt architecto laborum accusantium
    eos facere temporibus iure fugiat. 
    Et dicta incidunt ut deleniti eum alias earum.",

   "place": "83224 Blabla",
   "time_happening": "2019-09-25 03:29:46"
}

With this code I expect for the new instance to:

  • Get created by the user I'm logged in as,
  • And to get returned to me in the API Client I'm using(Insomnia)

Result:

I get redirected to Homepage and when I check if it's created in the database it's not.

What am I doing wrong?!