pritam1605

pritam1605

Member Since 2 Years Ago

Experience Points 9,170
Experience Level 2

830 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 64
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.

06 Jun
1 year ago

pritam1605 left a reply on Json Being Displayed Instead On Vue Component When Browser's Back <- Button Is Clicked

@nigelhv , @wilk_randall is correct. You will have to use 2 different routes. In my case, json was getting displayed on the page when I clicked back button on the browser after visiting the page that displayed all the videos uploaded by a particular user on my video portal. I separated the URLs like:

Route::get('{user}/videos', '[email protected]')->name('all.videos');
Route::get('/videos/user/{user}/all-user-videos', '[email protected]');

When the user clicks the button to see all the videos, the first route gets called. When the component loads, a new get request is made using axios to fetch all the videos uploaded by that user.

I hope this explanation will help you.

23 Apr
1 year ago

pritam1605 left a reply on Json Being Displayed Instead On Vue Component When Browser's Back <- Button Is Clicked

@FrankClark and @bertog I split the calls into 2 parts. One request would display the desired component and once the component is loaded, I would make a call to the API to fetch the data.

I solved it by splitting the request.

18 Nov
1 year ago

pritam1605 started a new conversation Mass Update One Of The Fields In The Has-many Relationship

I have a One to Many relationship between Channel and Video table. Both tables have visibility field. When I update the visibility of a channel, I want to update the visibility of all the videos that belong to that channel.

How to achieve this mass update functionality?

01 Sep
1 year ago

pritam1605 started a new conversation Laravel Not Storing Session Data In Redis

Hello, I just decided to switch to Redis to store my session and cache data. But Laravel seem to using local file storage itself.

I have installed the predis composer dependency and have changed the config to:

SESSION_DRIVER=redis

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=secret
REDIS_PORT=6379

also in the config/session.php file, I have used 'connection' => 'redis',. Still it seem to store all my login cookies and session data in the storage/framework/session

What do I need to do??

25 Aug
1 year ago

pritam1605 started a new conversation Queue Killing The Tasks

I am using SQS to upload my videos to the S3 bucket in the background. The queue works perfectly fine for small videos (~40 MBs). But, when I try to upload bigger videos (say 70 MBs) the queue operation gets killed. Here's my queue operation's output:

[email protected]:~/Laravel/youtube (master)*$ php artisan queue:work --tries=3
[2017-08-25 17:48:13] Processing: App\Mail\SocialLoginAccountLinked
[2017-08-25 17:48:20] Processed:  App\Mail\SocialLoginAccountLinked
[2017-08-25 17:48:42] Processing: Laravel\Scout\Jobs\MakeSearchable
[2017-08-25 17:48:45] Processed:  Laravel\Scout\Jobs\MakeSearchable
[2017-08-25 17:48:51] Processing: App\Jobs\VideoUploadJob
Killed
[email protected]:~/Laravel/youtube (master)*$ php artisan queue:work --tries=3
[2017-08-25 17:50:33] Processing: App\Jobs\VideoUploadJob
Killed
[email protected]:~/Laravel/youtube (master)*$ 

Where do I need to change the setting?? Something on Laravel side or on SQS?? Can anyone help me?

23 Aug
1 year ago

pritam1605 left a reply on "Class 'Socialite' Not Found"

@jha Here's my controller code:

<?php

namespace App\Http\Controllers\Auth;

use Socialite;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class SocialLoginController extends Controller {

    public function redirectToProvider($service, Request $request) {
        return Socialite::driver($service)->redirect();
    }

    public function handleProviderCallback($service, Request $request) {

    }
}

I am trying to access the link ``dev.myapp/login/github```

22 Aug
1 year ago

pritam1605 started a new conversation "Class 'Socialite' Not Found"

I am using Socialite package in my app. I followed all the instructions from the official github page. I am using Laravel 5.4.27. When I try to run the app, I get "Class 'Socialite' not found"error. What do I need to do??

I have use Socialite; statement also and I am using version 3 of socialite. I have also used Laravel\Socialite\SocialiteServiceProvider::class, and 'Socialite' => Laravel\Socialite\Facades\Socialite::class,

I even used composer dump-autoload

Please help me

pritam1605 started a new conversation "Class 'Socialite' Not Found"

I am using Socialite package in my app. I followed all the instructions from the official github page. I am using Laravel 5.4.27. When I try to run the app, I get "Class 'Socialite' not found"error. What do I need to do??

I have use Socialite; statement also and I am using version 3 of socialite. I have also used Laravel\Socialite\SocialiteServiceProvider::class, and 'Socialite' => Laravel\Socialite\Facades\Socialite::class,

What do I do?

pritam1605 started a new conversation Problems Using Nullable And Image Validation Rule Together

I am trying to upload an optional image to the back-end and am validating the image if it is uploaded. I am using the following rule:'channelImage' => 'nullable|image', I even tried replacing nullable with sometimes but to no avail. I used sometimes and nullable together, but that didn't work either.

Has anyone faced similar problem?

16 Aug
2 years ago

pritam1605 left a reply on View Not Found Error While Sending Email

I found the answer, For whatever reason I had closed(ended) the markdown component twice @endcomponent.

15 Aug
2 years ago

pritam1605 started a new conversation Image Validation Rule Not Working As Expected

Here's my validation rule:

public function rules() {
        $channel_id = Auth::user()->channels->first()->id;

        return [
            'name' => 'required|max:30|unique:channel,name,' . $channel_id,
            'slug' => 'required|max:30|alpha_num|unique:channel,slug,' . $channel_id,
            'description' => 'max:1000',
            'channelImage' => 'image',

        ];
    }

    public function messages() {
        return [
            'slug.unique' => 'That  unique URL has already been taken.',
            'channelImage.image' => 'Only jpeg, jpg, png, bmp, gif and svg formats are supported.',
        ];
    }

Although, is it not mandatory to upload channel image while filling the form, the image validation rule for channelImage works as if it's mandatory i.e. I need to upload an image every time I submit the request.

Why is working like that?? I did not mention required rule for channelImage, still why it is validating channelImage when I am not uploading any image?

pritam1605 started a new conversation View Not Found Error While Sending Email

I am sending 2 emails to the user, one when he registers and one when he requests to reset his password (forgot password functionality). The code is similar for both of the above mentioned functions. However, email is getting sent successfully whenever a user registers a new account, whereas I am getting View [] not found. (View: /home/vagrant/Laravel/youtube/resources/views/emails/password/reset.blade.php) error. Similar code, just changed the file name and some backend logic.

Here's the code where the mail is being sent (Mail Class)

public function build() {
        return $this->subject('Reset your password')
                    ->markdown('emails.password.reset')
                    ->text('emails.password.reset_text');
    }

Here's the markdown file emails/password/reset.blade.php

@component('mail::message')
<strong>Hello {{ $token->user->getFirstNameOrUserName() }}!</strong>

You are receiving this email because we received a password reset request for your account.
If you did not request a password reset, no further action is required.

@component('mail::button', [
    'url' => route('password.reset', ['token' => $token,]) . '?email=' . urlencode($token->user->email)
])
Reset Password
@endcomponent

Thanks,<br>
{{ config('app.name') }}
@endcomponent

<hr>
If you’re having trouble clicking the <strong>"Reset Password"</strong> button, copy and paste the URL below into your web browser:<br>
<small>{{ route('password.reset', ['token' => $token,]) . '?email=' . urlencode($token->user->email) }}</small>

@endcomponent

I am getting View [] not found. (View: /home/vagrant/Laravel/youtube/resources/views/emails/password/reset.blade.php)

Don't really know why. I guess, I need a second pair of eyes to find out the mistake.

14 Aug
2 years ago

pritam1605 started a new conversation Json Being Displayed Instead On Vue Component When Browser's Back <- Button Is Clicked

I have created a small project using Laravel 5.4 and VueJs 2.0. It is not a Single Page Application. I am using vue components on each and every page to display the contents. The flow of my application goes like this: Whenever a use clicks on the tab in navbar, he's redirected to the respective component. On the laravel side, I am simply using return view(login); and on the login.blade.php, I am using <login-component></login-component> which then sends the ajax requests to fetch data. I don't really know if this is the right approach to get a single page by using 2 http requests (if anyone knows a better approach, please do let me know). Mostly, for the ajax requests to load the vue component, the controller returns json data. Everything works fine, but when I click the back <- button on the browser, only json gets displayed. I then have to refresh the page (ctl + R) in the browser the get the vue component.

Here's the controller code:

public function index(Request $request, VideoRepository $video_repo, Channel $channel) {

    if ($request->ajax()) {
        $videos = $video_repo->getChannelVideos($channel);

        return response()->json([
            'data' => [
                'message'=> 'Success',
                'videos' => $videos,
                'channel' => $channel,
            ]
        ], 200);
    }

    return view('channels.index')->with([
        'channel_slug' => $channel->slug,
    ]);
}

Here's my channel.index page:

@extends('templates.default')

@section('content')
    <channel-dashboard channel-slug="{{ $channel_slug }}"></channel-dashboard>
@endsection

Here's my channel-dashboard vue component:

axios.get('/channels/' + this.channelSlug)
     .then(({data}) => {
        this.videos = data.data.videos;
        this.channel = data.data.channel;

        this.divideVideosArrayInChuncks();
     })
     .catch(({response}) => {
        this.error = response.data;
     });

What do I need to do get vue component

11 Aug
2 years ago

pritam1605 started a new conversation How To Send Password Securely To Server

I have created vue components for login and registration. How do I send password to the server?? Should I just encrypt the password using bcrypt on the client side and then send it to Laravel or should I just send the plain password to Laravel and use bcrypt($request->get('password')); What would be a good option?

If I should encrypt the password in the vue component, what package/function should I use so that it will encrypt the password in the same way as Laravel/PHP does??

04 Aug
2 years ago

pritam1605 started a new conversation Algolia Autocomplete Dropdown Hides Behind Navbar In Bulma

Hello, I am using algolia's algoliasearch package to show the search result in a dropdown. I am using bulma. Everything seems to be working fine but for whatever reason, dropdown results hide behind the navebar. I tried using z-index but nothing seems to be working fine. My CSS knowledge is pretty limited.

Any suggestions??

pritam1605 left a reply on Not Able To Access The Variable Equivalent Of The Eloquent Method

@edoc $userVote = $this->votes()->where('user_id', $user->id)->first(); works fine. I wanted to access the eloquent property. Even $this->votes should work, shouldn't it?

03 Aug
2 years ago

pritam1605 started a new conversation Not Able To Access The Variable Equivalent Of The Eloquent Method

I have the following eloquent method in my application:

public function votes() {
        return $this->morphMany(Vote::class, 'votable');
    }

and when I try to access the variable votes (as laravel has dynamic properties) like $userVote = $this->votes->where('user_id', $user->id)->first();, I get the following error: "Call to a member function where() on integer" and when I use dd($this->votes) it displays 2. I am all confused.

Where am I going wrong?

22 Jul
2 years ago

pritam1605 started a new conversation Redirection In Vue Js

I have a Vue component named searchbox and I want the users to get redirected to display the results once they type the name and click the search button. I am using axios to make the http request. Here's my template:

<form @submit.prevent="searchResult">
    <div class="field has-addons searchbox">
        <div class="control">
            <input class="input" type="text" id="search" name="q" placeholder="Search a video..." @keyup.enter="searchResult"  v-model="searchData">
        </div>

        <div class="control">
            <button class="button is-primary"><i class="fa fa-search"></i></button>
        </div>
    </div>
</form>

Here's my script in the Vue file:

<script>
    export default {

        data() {
            return {
                searchData: null,
            };
        },

        methods: {
            searchResult() {
                axios.get('/search?q=' + this.searchData);
            }
        }       
    }
</script>

Here's my search controller:

class SearchController extends Controller {

    public function index(Request $request) {
        return view('search.index');
    }
}

However, I can not see the redirection. How do I redirect from vue component to another route in laravel??

Is vue-router necessary or we can follow any other method??

14 Jul
2 years ago

pritam1605 started a new conversation Not Accepting Null Or Boolean In The Javascript

I have the following code on my home page.

<script>
            window.Laravel = <?php echo json_encode([
                'csrfToken' => csrf_token()
            ]); ?>

            window.myengine = {
                appUrl: '{{ config('app.url') }}',
                user: {
                    id: {{ Auth::check() ? Auth::user()->id : null }},
                    authenticated: {{ Auth::check() ? true : false }}
                }
            }
</script>

When the user is not signed-in, I get the following error

Uncaught SyntaxError: Unexpected token ,

This is what it looks like in the chrome developers tool.

<script>
               window.Laravel = {"csrfToken":"SUuyR60Tu16uUCcLv7QnxPOzVXyfWNZQUszcnnn3"}
            window.myengine = {
                appUrl: 'http://dev.youtube',
                user: {
                    id: ,
                    authenticated: 
                }
            }
        </script>

Javascript should accept null and booleans, shouldn't it??

12 Jul
2 years ago

pritam1605 started a new conversation Infinite Scrolling In Vue

How can I implement infinite scrolling in vue js?? I am using paginate to return limited number of records initially, but when I reach at the bottom of the page I want to trigger the paginator function to load the next page records. How can I do that??

PS: I do not want to use any third-party plugin for scrolling.

Thank You.

05 Jul
2 years ago

pritam1605 started a new conversation Progress Bar With Axios

I have to display the upload status of the file using a Progress Bar. I am using axios to make http requests. I followed the example from their github page https://github.com/mzabriskie/axios/blob/master/examples/upload/index.html

My code looks like this:

this.store().then(() => {
    var form = new FormData();
        form.append('video', this.file);
        form.append('uid', this.uid);

        axios.post('/upload', form, {
            progress: (progressEvent) => {
                    if (progressEvent.lengthComputable) {
                            console.log(progressEvent.loaded + ' ' + progressEvent.total);
                this.updateProgressBarValue(progressEvent);
                         }
                 }
          })                   
});

However, it is not executing the console.log(progressEvent.loaded + ' ' + progressEvent.total); at all nor is it calling this.updateProgressBarValue(progressEvent);

How can I solve this??

I am new to the world of javascript.

01 Jul
2 years ago

pritam1605 started a new conversation File Not Getting Deleted

I am using Storage::delete($file_path) to delete the file. It isn't deleting the file. Also, File::delete($file_path) doesn't seem to be working. My file is stored in the /storage/uploads folder.

What could possibly have gone wrong??

Does it have something to do with the permission??

pritam1605 started a new conversation Failed Jobs In Laravel

I am new to the world of Queues. I am using SQS in my project and somwhow the jobs are failing. I am using php artisan queue:work --tries=3 and the jobs are failing. Do I need to use failed_jobs table or AWS SQS will itself handle the failed jobs or I can only use the failed_jobs database table if i am using database as the queue driver in my laravel project?? I am all confused.

06 Jun
2 years ago

pritam1605 left a reply on Associate Method Is Not Working

Found the answer, I wasn't logged in. Sorry for wasting your time :(

pritam1605 started a new conversation Associate Method Is Not Working

I have one to many relationship between user and topics

The code is as follows: User model

public function topics() {
        return $this->hasMany(Topic::class);
    }

Topic model

public function user() {
        return $this->belongsTo(User::class, 'user_id');
    }

routes/web.php

Route::get('/topic/one-to-many', function(Request $request) {
      $topic = new Topic();
      $topic->user()->associate($request->user());
      $topic->topic = 'Topic one';

      $topic->save();
});

When I run the above route it gives the the following error:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'user_id' cannot be null (SQL: insert into `topics` (`user_id`, `topic`, `updated_at`, `created_at`) values (, Topic one, 2017-06-06 01:24:58, 2017-06-06 01:24:58))

Topics migration

Schema::create('topics', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->string('topic');

            $table->foreign('user_id')
                  ->references('id')
                  ->on('users')
                  ->onDelete('cascade');

            $table->timestamps();
        });

Where am I going wrong??

05 Jun
2 years ago

pritam1605 left a reply on Laravel Echo Isn't Listening To The Broadcast Event

@Murpha yes, you are right. and I didn't post the whole cole. I am broadcasting the event in the controller itself. Here's the code:

public function postStatus(PostStatusRequest $request) {

        $status = Auth::user()->statuses()->create([
            'body' => $request->get('status'),
        ]);

        $status->load('user');

        broadcast(new StatusWasPosted($status))->toOthers();

        return response([
            'status' => $status,
            'message' => 'Status posted.',
        ], 200);
    }
04 Jun
2 years ago

pritam1605 started a new conversation Laravel Echo Isn't Listening To The Broadcast Event

I am trying to broadcast the event when a user creates a post to all his friends. Laravel Echo isn't listening to the events. I can see the logs on the Pusher site. So the event is being sent to the pusher.

Here's my timeline code:


<template>
    <div>
        <div class="row">
            <status-box :authUser="authUser"></status-box>
        </div>

        <div class="row">
            <div class="col-lg-8">
                <div v-if="statuses.length">
                    <status v-for="status in statuses" :status="status"></status>
                </div>
                <div v-else>
                    <p>No posts to show yet.</p>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import EventHub from './../eventhub.js';

    export default {

        data() {
            return {
                statuses: [],
                authUser: null,
            };
        },

        methods: {
            pushNewStatus(status) {
                status.parent_id = null;
                this.statuses.unshift(status);

                // Broadcasting the event to so that user's friends can see the post in realtime
                Echo.private('status.' + status.id)
                    .listen('StatusWasPosted', (e) => {
                        this.pushNewStatus(e.status);
                    });
            }
        },

        mounted() {
            EventHub.$on('status-posted', this.pushNewStatus)

            axios.get('/chatty/getStatuses/')
                .then(({data}) => {
                    this.statuses = data.statuses;
                    this.authUser = data.user_name;
                })
                .catch(error => console.log(error));
        }
}
</script>

Here's the channel authorization logic:

Broadcast::channel('status.{statusId}', function ($user, $statusId) {
    $status = Status::find($statusId);
    $status_owner = User::find($status->user_id);
    return $user->isFriendsWith($status_owner);
});

Here's the channel name in the StatusWasPosted event class

public function broadcastOn() {
        return new PrivateChannel('status.' . $this->status->id);
}

I am emitting status-posted in the status compoenet when a new status is created.

Where am I going wrong??

pritam1605 started a new conversation Need Help With The Logic

I am building a small social network using laravel 5.4 and vue2.0. I want to broacast the posts created by the user only to his friends. What broadcasting channel do I need to user?? Private or Presence??

Thank You

03 Jun
2 years ago

pritam1605 started a new conversation Pusher : Couldn't Get Auth Info From Your Webapp : 403

I created most of my project using Laravel 5.3, to use some features introduced in Laravel 5.4, I migrated to Laravel 5.4.

Now, to use event broadcasting, I manually added the routes/channels.php file and added the following code in it.

 Broadcast::channel('status_posted_global', function () {
            return true;
        });

I just followed the documentation. But looks like it isn't working and I get Pusher : Couldn't get auth info from your webapp : 403 error.

However, it works fine, when I put

Broadcast::channel('status_posted_global', function () {
            return true;
        });

in the /app/Providers/BroadcastServiceProvider.php file.

Why so??? Do I need to register routes/channels.php file somewhere??

31 May
2 years ago

pritam1605 left a reply on Issues With Axios Catch Method

@Borisu I did what you said. I did the same in another project, but I am still getting the same error.

Either I am repeating some stupid mistake or something's wrong with axios (which seems unlikely).

updateStatus() {
       axios.post('/chatty/status', {
             body: this.body,
       }).then(response => console.log(response))
             .catch(error => console.log(error));
       }
                    

whenever I submit empty text to the server, laravel performs its validation to check for the required field and then returns the error.

console.log(error) returns this

Error: Request failed with status code 422
    at createError (app.js:2291)
    at settle (app.js:8935)
    at XMLHttpRequest.handleLoad (app.js:2129)

What's wrong with my code?? :(

30 May
2 years ago

pritam1605 started a new conversation Using Twitter Bootstrap In Laravel

I am new to the frontend world. Until now I was using CDN to link use twitter bootstrap like this

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />

Now, I want to use bootstrap using npm So I did npm install and gulp watch and replaced the above link tag with <link href="{{ asset('css/app.css') }}">

But it didn't work for me. In fact, I lost all my styling. I noticed in the package.json file that laravel makes use of "bootstrap-sass": "^3.3.7", where as in the above link tag I was using just bootstrap.

Sorry, if I am asking stupid questions, but, is there any difference between bootstrap-saas and bootstrap??

If so, how do I use bootstrap into my project using npm? I did npm install [email protected] but don't really know how to use it in my project??

28 May
2 years ago

pritam1605 left a reply on Issues With Axios Catch Method

@Borisu I can't accept that as a solution. Still debugging :(

26 May
2 years ago

pritam1605 started a new conversation Why No Dispatch And Broadcast

On the website, the author mentioned that they have been replaced by emit to us from future pains. Here's what he wrote: The problem is event flows that depend on a component’s tree structure can be hard to reason about and very brittle when the tree becomes large. It simply doesn’t scale well and we don’t want to set you up for pain

I didn't really understand, what he meant. I agree that dispatch doesn't allow communication between sibling components. Can anyone explain me?? I am new to the world of the javascript framework.

pritam1605 left a reply on Issues With Axios Catch Method

@Borisu I'll debug each and every like again. I don't really know a lot about this. I am new to the Javascript world

pritam1605 left a reply on HOW I Can Call A Controller Within Function

@dawerdrew sorry I didn't understand your question properly. I think you can try this redirect()->action('[email protected]'); It will redirect the control to the controller mentioned in the action method execute the method.

pritam1605 left a reply on Issues With Axios Catch Method

@jbloomstrom it's working fine when when I used your solution. Could you please explain why is it working when I put both in the then method??

25 May
2 years ago

pritam1605 left a reply on Issues With Axios Catch Method

@Borisu It still didn't solve the issue. Still getting the same error.

pritam1605 left a reply on HOW I Can Call A Controller Within Function

try using action('[email protected]'); helper function

24 May
2 years ago

pritam1605 started a new conversation Issues With Axios Catch Method

I followed Jeffery's Vue2.0 series. For whatever reasons I am not able to post the question on that video. Let me try it here.

I am using axios to make the HTTP request to post the data. It's working perfectly finem but when when I try to submit the empty body (which I shouldn't) I don't see the error message in the span block down there. I get something like this in the console.

POST http://..../statuses 422 (Unprocessable Entity) /#/:1 Uncaught (in promise) Object {ob: Observer}

Network preview shows:

{body: ["The body field is required."]} body: ["The body field is required."]

Here's the code that makes use of Axios.

eturn new Promise((resolve, reject) => {
            axios[requestType.toLowerCase()](url, this.getData())
                .then(response => {
                    this.onSuccess(response);
                    resolve(response);
                })
                .catch(error => {
                    this.onFail(error);
                    reject(error);
                });
        });
23 May
2 years ago

pritam1605 started a new conversation Change Router-link Class

When I add router-link, it automatically adds router-link-exact-active router-link-active class. How do I replace it??

I added linkActiveClass: 'is-active' in the vue-router object, it gives me router-link-exact-active is-active class. I just want is-active class. What do I do??

pritam1605 started a new conversation Webpack --watch Doesn't Trigger An Auto-recompilation

node_module/.bin/webpack --hide-modules --watch doesn't trigger an auto-recompilation. What do I do?? I am using Homestead.

15 May
2 years ago

pritam1605 left a reply on Vue Component Not Loading

Done. I reinstalled the project. It is working now. Sorry for the trouble.

pritam1605 left a reply on Learning Vue

@topvillas I meant to say, should I learn Vue 2.0 or I can manage with Vue 1.0 for the time being. :)

pritam1605 started a new conversation Vue Component Not Loading

I am new to Vue and as of now I am using Vue 1.0. In my laravel app vue components aren't getting loaded. I ain't getting any error in the Vue devtool or the chrome devtool either. Here's my code:

My master.blade.php layout:

<!DOCTYPE html>
<html>
    <head>
        <title>Vue</title>


    </head>
    <body>
        <div id="app">
            <component is="{{ $vueView }}">
                @yield('content')
            </component>
        </div>
        <script src="{{ asset('js/main.js') }}"></script>
    </body>
</html>

My about_page.blade.php

@extends('layouts.master', ['vueView' => 'AboutView'])

@section('content')
    <h2>About View</h2>
@endsection

My home_page.blade.php

@extends('layouts.master', ['vueView' => 'HomeView'])

@section('content')
    <h2>Home View</h2>
@endsection

My resources/assets/js/dynamic_components.js

// Browserify Entrypoint

import Vue from 'vue';
import HomeView from './components/HomeView.vue';
import AboutView from './components/AboutView.vue';


new Vue({
    el: '#app',

    components: {
        HomeView, AboutView
    }
});

My /resources/assets/js/components/AboutView.vue

<template>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Atque placeat, quis maiores sequi inventore, voluptatibus labore hic fugit, autem consequuntur ipsum ex laudantium. Accusamus optio veniam velit, laudantium. Odit, facilis.
</template>

<script>
    export default {
        ready() {
            alert('home view is ready');
        }
    }
</script>

My /resources/assets/js/components/HomeView.vue

<script>
    export default {
        created() {
            alert('Welcome to the Home Page');
        }
    }
</script>

My routes.php

Route::get('/home-view', function () {
    return view('home_view');
});

Route::get('/about-view', function () {
    return view('about_view');
});

My gulpfile.js

    var elixir = require('laravel-elixir');
    require('laravel-elixir-vueify');
    
    elixir(function(mix) {  
        mix.browserify(['main.js', 'dynamic_components.js']);
    });

All it shows is the h2 from home_page.blade.php and about_page.blade.php respectively. Where am I going wrong???

Sorry for such a long post....

pritam1605 started a new conversation Learning Vue

I am somewhat comfortable with Vue1.0. In fact, I am a beginner. Show I just stick with Vue 1.0 or go ahead and learn Vue 2.0. PS: I am new to the world of javascript frameworks.

pritam1605 started a new conversation Change Vue Version In Laravel

I am at a beginners level with vue 1.0 and don't really have enough time to learn vue 2.0. I am using laravel 5.3, how can I change vue version in laravel 5.3 and compile that using gulp and start using it in my project? What files do I need to edit??

pritam1605 left a reply on How To Decrypt Hash Password In Laravel

You just can't. It's a one way encryption.