jet

jet

Member Since 1 Year Ago

Experience Points
3,280
Total
Experience

1,720 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
3,280 XP
Nov
08
1 week ago
Activity icon

Started a new Conversation How Can I Create A Service That Will Be Responsible For All My Api An Consume It With The Component

here is what i try doing postService


import axios from "axios";

const baseDomain = "/academic/";
const baseURL = `${baseDomain}/`;

const Repository = axios.create({
  baseURL,
  // headers: { Authorization: `Bearer yourSuppaToken` }
});

const resource = "/academicsession";

export default {
  // Just FYI...

  getAll() {

   return Repository.get(`${resource}`);
 },
  getOne() {

   return Repository.get(`${resource}`);
   // return Repository.get(`${resource}/${postId}`);

 },
  createOne(payload) {

   return Repository.post(`${resource}`, payload);
 },
  updateOne(id, payload) {

   return Repository.put(`${resource}`,id, payload);
 },
  deleteOne(id) {

   return Repository.post(`${resource}`, id);
 },

};

how can i use it in the component

Oct
30
2 weeks ago
Activity icon

Started a new Conversation Fatal Error: Uncaught ArgumentCountError: Too Few Arguments To Function Multiphalcon\Modules\Lms\Controllers\QuestionController::indexAction(), 0 Passed And Exactly 2 Expected

how can i fix this controller api

    public function indexAction($level, $target)
    {
        // temporal code
        $options = [];
        $qs = Question::find(
            [
                "level = :level: AND target = :target:",
                "bind" => [
                    "level" => $level,
                    "target" => $target,
                ],
            ]
        );
        foreach ($qs as $q) {
            $options[$q->id] = $q->getAnswer();
        }
        return $this->response->setJsonContent([
            "questions" => $qs, 'options' => $options]);

    }

vue

  loadQuestion: function () {
        var _this = this
        window.axios.get('/lms/question/getall' + this.level + '/' + this.target)
        .then(function(res){
          _this.questions = res.data.questions
          // _this.questions = res.data
        })
      },
Sep
07
2 months ago
Activity icon

Started a new Conversation 422 (Unprocessable Entity) // CreateError.js:16 Uncaught (in Promise) Error: Request Failed With Status Code 422

hi, i have this error that i can figure it out this is my component

  export default {

      components: {
        'personalinfo-form-component':PersonalInfoFormComponent,
        'personalinfo-detail-component':PersonalInfoDetailComponent
      },

      created: function() {
          this.loadInfo()
      },

      data() {
          return {
              url: '/api/users',
            personalInfo:
                   {
                   country: '',
                    state: '',
                    city: '',
                    addressline1: '',
                    addressline2: '',
                    postCode: '',
                    mobile: '',
                    tel: ''
                   },
            isDetail: true,
          }
      },

      methods: {

          toggle: function() {
            this.isDetail = !this.isDetail;
          },

        saveData: function (data) {
            console.log(data);
            let _this = this

            axios.post(this.url, data)
                .then(function(res) {
                    const re = res.data
                    _this.personalInfo = data
                    _this.toggle();
                })
                .then(function(err) {
                    console.log(err)
                })
        },

        loadInfo: function() {
            let _this = this

            window.axios.get(this.url)
                .then(function(res) {
                    if (res.data) _this.personalInfo = res.data
                })
                .catch(function(err) {
                    console.log(err)
                })
        }


      }
    }
</script>

here ia the form

<template>
    <div class="personalInfo">
        <div class="form">
            <div class="form-group">
                <label>Country</label>
                <select v-model="personalInfo.country" class="form-control">
                  <option v-for="country in countries" v-bind:value="country.value">
                    {{ country.text }}
                  </option>
                </select>
            </div>
            <div class="form-group">
                <label>State</label>
                <input type="text" class="form-control" placeholder="State" v-model="personalInfo.state" />
            </div>
            <div class="form-group">
                <label>City</label>
                <input type="text" class="form-control" placeholder="City" v-model="personalInfo.city" />
            </div>
            <div class="form-group">
                <label>AddressLine1</label>
                <input type="text" class="form-control" placeholder="AddressLine1" v-model="personalInfo.addressline1" />
            </div>
            <div class="form-group">
                <label>AddressLine2(Optional)</label>
                <input type="text" class="form-control" placeholder="AddressLine2(Optional)"/>
            </div>
            <div class="form-group">
                <label>PostCode</label>
                <input type="text" class="form-control" placeholder="PostCode" v-model="personalInfo.postCode"/>
            </div>
            <div class="form-group">
                <label>Mobile</label>
                <input type="number" class="form-control" placeholder="Mobile" v-model="personalInfo.mobile" />
            </div>
            <div class="form-group">
                <label>Tel</label>
                <input type="number" class="form-control" placeholder="Tel" v-model="personalInfo.tel" />
            </div>
            <button class="btn btn-sm " @click="cancelForm()">Cancel</button>
            <button class="btn btn-sm btn-info" @click="submit()">Save</button>
        </div>
    </div>
</template>


<script>

    export default {
      created: function () {

      },

      props: ['personalInfo'],

      data() {
          return {

            selected: 'USA',
            countries: [
              { text: 'USA', value: 'USA' },
              { text: 'Cameroon', value: 'Cameroon' },
              { text: 'Germany', value: 'Germany' },
              { text: 'Spain', value: 'Spain' },
              { text: 'England', value: 'England' }
            ]
          }
      },

      methods: {
          
          submit: function() {

          

            this.$emit('onSubmit', this.personalInfo);

          },

        
          cancelForm: function() {
            this.$emit('onToggle');
        }
      }
    }
</script>

i will be very happy if any one can help

Sep
04
2 months ago
Activity icon

Replied to Delete Request In Vue Js Using Axios An Sweet Alert

there are no errors here is the PHP

//academicsession
$academicsession = new MicroCollection();
// Set the main handler. ie. a controller instance
$academicsession->setHandler("AcademicSessionController", true);

// Set a common prefix for all routes
$academicsession->setPrefix("/api/academic-session");
$academicsession->get("/", "getAll");
$academicsession->get("/{id}", "getOne");
$academicsession->put("/{id}", "updateOne");
$academicsession->post("/", "createOne");
$academicsession->delete("/{id}", "delete");
$app->mount($academicsession);
Activity icon

Started a new Conversation Delete Request In Vue Js Using Axios An Sweet Alert

i have done this but when i delete an item i shows that it has been deleted and when i look at the database it's still there.

      removeAcademicsession: function (id) {
          var _this = this

          swal({
            title: 'Are you sure?',
            text: "You won't be able to revert this!",
            type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!'
          }).then((result) => {
            if (result.value) {
              window.axios.delete('/api/academic-session/' + id)
              .then(function (res) {
                swal(
                  'Deleted!',
                  'Academicsession has been deleted.',
                  'success'
                )


                _this.loadAcademicsession()
              })

            }

any help pls

Aug
04
3 months ago
Activity icon

Replied to Laravel Service Provider To Insert A Header To The Database

i have this error Call to undefined function App\Providers\runningInConsole() after using the code. also with this

Aug
03
3 months ago
Activity icon

Replied to Laravel Service Provider To Insert A Header To The Database

i can write it manually. but can the rest can be gotten if yes how can i do to get them with more especially the user_agent

Activity icon

Started a new Conversation Laravel Service Provider To Insert A Header To The Database

here is the service provider

 public function boot()
    {
         $key = $this->app->request->header('User-Agent');
    }

i need to save the header in to the login_history table colum call user_agent in the db.

    public function up()
    {
        Schema::create('login_histories', function (Blueprint $table) {
            $table->increments('id');
            $table->string('user_agent');
            $table->string('ip')->nullable();
            $table->string('email');
            $table->string('status');
            // $table->dateTime('created_at');
            $table->timestamps();
        });

please how can i do it anyone help thanks.

Jul
30
3 months ago
Activity icon

Replied to Class 'App\Http\Controllers\Storage' Not Found

Add this use Storage;

Activity icon

Started a new Conversation Create A Middleware That Reads The Header Of Every Request And Write It In A Text File In The Public Folder

Here is my Kernel.php

 protected $routeMiddleware = [
        'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
        'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
        'can' => \Illuminate\Auth\Middleware\Authorize::class,
        'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'myHeader' => \App\Http\Middleware\MyHeaderMiddleware::class,
        'secure.api' => \App\Http\Middleware\SecureApi::class,
    ];

here is the meddleware

<?php

namespace App\Http\Middleware;

use Closure;

class MyHeaderMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        return $next($request);
        $response->header('Cache-Control', 'application/json, public');
        return $response;
    }
}

route

Route::group(['middleware' => ['myHeader']], function () {

    Route::get('product-features/{id}', '[email protected]');
    Route::post('product-features', '[email protected]');
    Route::delete('product-features/{id}', '[email protected]');
    Route::get('plan-features', '[email protected]');
    Route::post('plan-features', '[email protected]');

});

help anyone please

Activity icon

Replied to Namespace Declaration Statement Has To Be The Very First Statement In The Script (Laravel 5.2.5)

Do you have any whitespace between your opening php tag and the namespace declaration?