0 Best Reply Awards

  • Member Since 9 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

17th November, 2017

frutos93 left a reply on How Many Javascript Frameworks Should I Learn That Is "enough"? • 7 months ago

I'd say to start is completely fine, but as time goes you will learn and have to use other front and back end frameworks. To the list I would also add database(if going with laravel then mysql) That should give you a good headstart

Of course there are a lot of things to consider like if you're going to be working as a freelancer, in a company, what type of projects will you be doing and more. But for basics I think it's really good to master those mentioned.

13th October, 2017

frutos93 left a reply on Modal Subcomponent In List • 8 months ago

Does it really needs to be a modal? Because If you want a desktop notification this could be helpful:

if (!('Notification' in window)) {
                        alert('Web Notification is not supported');

                    Notification.requestPermission(permission => {
                        let notification = new Notification('New post alert!', {
                            body: "YOUR TEXT GOES HERE", // content for the alert

If you do really need a modal, I would recommend, instead of using the v-showput the modal HTML within the main component and enable show the modal whenever the Event is listened using $('#myModal').modal('show'); and just display the data with the corresponding data.

frutos93 left a reply on Passing Data To Components • 8 months ago

As @jbloomstrom said, formatt the code with 3 blackticks at the beggining and at the end

{{ tipo.descricao }}

<app-formulario :campos="lista[index].tipo_registro_campos"></app-formulario> ` will produce

<tr v-for="(tipo, index) in listaOrdenada"> 
    <td @click="selected">{{ tipo.descricao }}</td>

<app-formulario :campos="lista[index].tipo_registro_campos"></app-formulario>

Concerning your question:

send the @click="selected" the object you are using, or just the parameter you need, like this:

<tr v-for="(tipo, index) in listaOrdenada"> 
    <td @click="selected(tipo.tipo_registro_campos)">{{ tipo.descricao }}</td>

that will send to the function the required item you need. Note that you are sending the item to the function, not to <app-formulario>

11th October, 2017

frutos93 left a reply on Laravel Real-time Chat Package • 8 months ago


Will change it later today then.

I will also check into tests, not sure how to implement them but will read docs. Thanks, and yeah, you're right, it would be better if they were interchangeable, but first I will complete it with pusher and after it is complete with more features I'll add

frutos93 left a reply on Laravel Real-time Chat Package • 8 months ago

@tisuchi As I said, this is my first package and I do have several questions. Not sure if you could help me or not:

Why in the package it appears composer create-project frutdev/laravchat instead of composer require frutdev/laravchat ?

frutos93 left a reply on Laravel Real-time Chat Package • 8 months ago

@tisuchi Considered pusher because of the accessibility it has with Laravel as well as the free plan that it has.

But it is indeed an option to make it work with, might do another package later for whichever the user would like to use.

frutos93 left a reply on Generating CSS From From SASS Based On Variables Values From Database • 8 months ago

One possible way you could do this is retrieve the class in the controller and within the blade use <style></style> instead of importing a .css so you could use {{$blue->color}}

frutos93 started a new conversation Laravel Real-time Chat Package • 8 months ago

Just created a Laravel package that is a real-time chat for users within the app. There are still a lot of things to improve and add.

This is my first package so if you have any suggestions feel free to tell me. I'm all ears. Hope you like it and that you don't find the installation so tedious.

9th October, 2017

frutos93 started a new conversation Laravel- Web Middleware Not Authenticating/Auth Middleware Not Working • 8 months ago

Developing a Laravel packages and in the routes I have this routes

Route::middleware(['web'])->group(function () {
    Route::get('/pckOne', 'Frutdev\LaravPck\Controllers\[email protected]');

    Route::get('/pckZone', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::post('/pckZone', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::get('/pckUsers', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::get('/pckUser', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::get('/pckArea', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::post('/pckArea', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::get('/{Area}/pckZones', 'Frutdev\LaravPck\Controllers\[email protected]');
    Route::post('/{Area}/pckZone', 'Frutdev\LaravPck\Controllers\[email protected]');

The routes are not being authenticated.

I tried with the web middleware but can still see/access the routes while not logged in. I tried with the auth middleware but even after logging in with the default Laravel loggin in system(which wasn't altered) I can't access the routes. It says I'm unauthorized, even after logging in. Any idea?

4th October, 2017

frutos93 started a new conversation Require Is Not Defined. Using Vue Within Laravel Package • 8 months ago

Developing a vue package and, within it, I'm trying to use Vue. but I keep getting ReferenceError: require is not defined

This error is present within the app.js file in the line


I read that I whould download the require.js file and add it to the blade but after it I get the error

Error: Module name "bootstrap" has not been loaded yet for context: _. Use require([])

Whenever I try to use Vue outside of the package itself there is no problem but within the project that appears. The folders are correctly arranged within the package folder.

3rd October, 2017

frutos93 left a reply on Using JS And CSS In A Laravel Package • 8 months ago

@Ruffles not working

frutos93 left a reply on Using JS And CSS In A Laravel Package • 8 months ago

@donavyn even though it is a package? So I should create a public folder within the package? src/public/js?

frutos93 started a new conversation Using JS And CSS In A Laravel Package • 8 months ago

I want to develop a package but how can I use JS and CSS files in the Views of the package?


How can I make this work:

<script src="js/app.js"></script>

28th September, 2017

frutos93 started a new conversation Good Practice To Make A Broadcast Of An Event For Every User's Channel? • 8 months ago

I'm making a chat application and at first I had a general channel in which every user joined as soon as the app was created.

            .listen('ThreadPosted', (e) => {});

ThreadPosted Is an event that is broadcasted whenever a user creates a new Thread with certain users on it.

The downside of this approach is that EVERY user within the 'chat' channel gets that Thread(later validation makes them not able to post but they still get it when it is created).

I was thinking that a way to approach this is by having each user have their own private channel whenever the app is created:

        Echo.private('App.User.' + userId)
            .listen('ThreadPosted', (e) => {

And when the new Thread is created then fire, several times, the broadcast event.


//$users contain all the users that will be in the new thread
foreach($users as $user){
    broadcast(new ThreadPosted($newThread, $user->id));

//ThreadPosted Event
public function __construct(Thread $thread, $user_id) {
        $this->thread = $thread;
        $this->user_id= $user_id;

public function broadcastOn() {
        return new PrivateChannelChannel('chat'.$user_id);

I'm not sure this is the best approach or if it is going to work but is there any other way to do that?

26th September, 2017

frutos93 started a new conversation Echo: On Successful Channel Join. • 8 months ago

How can I trigger an event/instructions when the user joins successfully a channel. I'm not saying how can I check whenever another user joins the channel because that is done using .join() I want to know how can I do something when the user, requesting to join the channel, joins succesfully

For example


Obviously .onSuccessfulJoin() is not a method but that's the idea of what I would like to do.

19th September, 2017

frutos93 left a reply on How To Broadcast To Certain Users Within A Channel? • 9 months ago

Anyone? Another way to see it is How can I another user, within the thread, join a channel whenever ThreadPosted is broadcasted? I tried putting the Echo.join inside the listen method but I would also like to do an action when a user(that has authorization) joins(push the thread to the array thread)

18th September, 2017

frutos93 left a reply on How To Broadcast To Certain Users Within A Channel? • 9 months ago

@Jaytee The problem is not to verify if a user is authorized to access a channel, the problem is how can I notify and make other users join a channel whenever a thread is posted.

example: User A creates a Thread in which user B is a participant. -ThreadPosted Event is fired. -How or in which channel should the event be broadcasted so that user B can be notified of the new thread without user C getting the notification.

frutos93 started a new conversation How To Broadcast To Certain Users Within A Channel? • 9 months ago

Developing a chat widget using Laravel 5.5, vue.js and pusher.

If a user creates a new conversation(new channel) how can I broadcast, or notify, the other users in the conversation that there is a new conversation.

At the moment I make every user that enters the page join a default channel and listen to the event that a conversation(thread) is posted. Every user gets the conversation and when the users, that do not belong to the chat, refresh the page the conversation disappears(this is a validation in which you do a GET request to retrieve the conversations you belong to).

I would like a way to, instead of every user, just make the correct users listen to that event.

        .listen('ThreadPosted', (e) => {

Another question I have: Is it better to join every channel, of every conversation, once the app is created OR whenever you change the conversation you are viewing exit the last channel and join the new channel of the conversation. Aaaand can a channel listen to several events?

12th September, 2017

frutos93 started a new conversation Retrieve User Name In Vue.js • 9 months ago

I have an vue component in which I would like to send the logged user name and it's structured this way:

export default {
                messageText: ''
                this.$emit('messagesent', {
                    user: {
                    name: Auth()::user()->name
                this.messageText = '';

Auth user doesn't work, it throws an error.


How can I retrieve the logged user name in a vue method?

28th August, 2017

frutos93 started a new conversation No Query Results For Model [RampUp\Skills]. • 9 months ago

Whenever I try to access /skills/add I get No query results for model [RampUp\Skills].

Tried using dd("test") but won't even appear

This are my routes for skills/add

Route::put('/skills/add', '[email protected]');

Route::get('/skills/add', '[email protected]');

Here are my functions in SkillsController

public function addIndex() {
        if (Auth::check()) {
            return view('skills.add');
        } else {
            return redirect('/home');


public function add(Request $request) {
        /*Sets validation rules for Skill object*/
        $skillRules = [
            'name' => 'required|max:25|regex:/[1-9a-zA-Z ]\w*/',
        if (Skills::where('name', '=', $request->name)->count() > 0) {
            return redirect('/skills')->with('message', "EXISTS");

        $validator = Validator::validate($request->all(), $skillRules);
        if ($validator == null) {
            $newSkill = new Skills;
            $newSkill->name = strtolower($request->name);
            return redirect('/skills')->with('message', "CREATED");

the skills.add view is this



<div class="container">
    <h1>Edit Skill</h1>
    <form method="POST" action="/skills/add">
        <div class="row">
            <div class="col-lg-5">
                <div class="form-group">
                    <input name="name" class="form-control">
        <div class="row">
            <div class="col-lg-2">
                <div class="form-group">
                <button type="submit" class="btn btn-primary">Add Skill</button>
                <a href="/skills"><button type="button" class="btn btn-danger">Cancel</button></a>
    @if (count($errors))
            <div class="form-group">
            <div class="alert alert-danger">
                    @foreach($errors->all() as $error)

Edit Your Profile

Want to change your profile photo? We pull from