alenabdula

alenabdula

Member Since 5 Years Ago

Sarajevo, Bosnia - living in Boston.

Web Designer / Developer at Sonora DesignWorks

Experience Points 57,035
Experience Level 12

2,965 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 346
Lessons
Completed
Best Reply Awards 30
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

27 Feb
1 year ago

alenabdula left a reply on Header Image On Homepage

Do you have any mockups? What have you tried? Are you using any CSS frameworks?

09 Nov
1 year ago

alenabdula left a reply on MIgration Issue

You can not add foreign key constraint like this. Foreign means other table. Also, you're adding two ID fields, this will not work.

Can you describe your relationship in words? For example!

A Job has many Materials. Materials belongs to a Job.

Please see https://laravel.com/docs/master/eloquent-relationships and https://laravel.com/docs/master/migrations#foreign-key-constraints

10 Oct
1 year ago

alenabdula left a reply on Problem With Routing My Application

Don't appologize for not being an expert in English, you should be proud of that, you'll learn a lot from interacting with us or any other community. English is also my second language.

You are using Vue-Router which takes over the routing and conflicts with your Laravel routing. Try setting Vue-Router mode to history, see https://router.vuejs.org/en/essentials/history-mode.html

this link will show a component that i made with VueJS, and i used the vue-router to make this call and show the component to the user.

What do you mean by "vue-router to make this call" are you referring to just loading the component or making some kind of API (ajax) call?

If your component doesn't require routing, define it as Vue Component and use it in your Blade templates, and remove Vue-Router from your dependencies. If you need to make API requests, you may use AxiosJS. Let me know if you need help setting this up or provide me with some more info. I'll help. Best, Alen.

15 Sep
1 year ago

alenabdula left a reply on Is 2 Weeks For Learning Laravel Fast?

Besides, what does it mean learn Laravel?

This 100%!

It really depends on what you are trying to accomplish. Is two weeks enough to get the basics down so you can have something up online, sure, however, learning Laravel is only part of the puzzle.

When I was in school, curriculum was behind to where the current state of web was at the time. So I switched all my classes and ended up learning on my own, after school.

Keep in mind that everything is hard before it's easy... so it's going to take some time before everything "clicks", take it slow and learn at your own pace and when you can.

Also, you have this great community always willing to help. Best of luck.

04 Sep
1 year ago

alenabdula left a reply on Vue.js Components And SEO

You shouldn't be rendering main content you're trying to index with Vue. Instead use Vue to add interactivity or extend HTML elements. As you said

for some user interactions/actions where possible

Such things don't really impact SEO anyways, if your main content is rendered with Blade and available for Google bot to index.

alenabdula left a reply on V-for Inside V-for

Your HTML is not correct, that could be the problem.

try

<ul v-for="item in order.type">
    <li v-text="item.name"></li>
    <ul v-for="option in item.options">
        <li v-text="option.name"></li>
    </ul>
</ul>
31 Aug
1 year ago

alenabdula left a reply on Laravel 5.5 New Preset Feature

@tyn Someone should file an issue on GitHub. I get the same error, when running following:

  • laravel new laravel.dev
  • php artisan preset none
  • yarn run watch

and get

WARNING  Compiled with 2 warnings

These dependencies were not found:

* bootstrap-sass in ./resources/assets/js/bootstrap.js
* jquery in ./resources/assets/js/bootstrap.js

removing following should be part of the scaffolding command, as jQuery is not and bootstrap is not in the package.json file.

/**
 * We'll load jQuery and the Bootstrap jQuery plugin which provides support
 * for JavaScript based Bootstrap features such as modals and tabs. This
 * code may be modified to fit the specific needs of your application.
 */

try {
    window.$ = window.jQuery = require('jquery');

    require('bootstrap-sass');
} catch (e) {}
28 Aug
1 year ago

alenabdula left a reply on Manipulating The DOM With Vuejs

@ArchStanton

Do not include another library just to do simple things. Unless you just need it to work and don't have time to mess around! Anyways...

VueJS click even is passed to the function, along with the target element that was clicked. So you can add/remove/toggle classes.

Here's a quick example, https://codepen.io/alenabdula/pen/QMZmgz

Hope that helps, best Alen.

alenabdula left a reply on What Is The Actual Role Of Forge

I've been on Digital Ocean for a while, and with Forge as soon as it was available. Never looked back. Once I had to regenerate my SSL certificate on Forge, forgot why, but it was simple click of a button. Forge provides everything I need and more, I've been satisfied.

Also, Forge is independent of Digital Ocean, so you can use Linode, Amazon or Custom VPS.

Hope that helps. Best, Alen.

21 Aug
1 year ago

alenabdula left a reply on Still An Error With Npm Run Dev

Remove the trailing comma

    "vue": "^2.1.10"
  },
18 Aug
1 year ago

alenabdula left a reply on Vue Component Inside A Foreach Loop

@ekrist1 There's nothing wrong with using Vue components in Blade's @foreach. Especially if the component requires specific data (in your case a contact). You can pass data as props, for example...

@foreach($contacts as $contact)
  {{ display something }}
  <favorite :contact="{{ $contact }}"></favorite>
@endforeach

Or, you can have a contacts component, that accepts the collection of $contacts and uses Vue's v-for to loop over them, for example.

<contacts :contacts="{{ $contacts }}"></contacts>
// Contacts.vue
<template>
  <div>
    <contact v-for="contact in contacts" :key="contact"></contact>
  </div>
</template>
<script>
  export default {
    props: ['contacts'],
  }
</script>
// Contact.vue
<template>
  <div>
    <!-- template for each contact -->
  </div>
</template>
<script>
  export default {}
</script>

Hope that helps, best Alen.

alenabdula left a reply on Search/filter Through Array From Another Component

In your Search component you declare the props, but did not pass any.

<search :conversations="conversations"></search>
06 Aug
1 year ago

alenabdula left a reply on Display Image From Laravel Public Folder In A Vue Component


new Vue({
  el: '#app',
  data: {
    image_src: '/img/obr1.jpg',
  }
});
<img :src="image_src">
31 Jul
1 year ago

alenabdula left a reply on Best Practice For Calculations

@graveeel

There would be 10 http requests

You're misunderstanding me. I'm saying, do calculations to visually present information to the user. Your initial AJAX request will contain, the price and etc., you wont be sending on any requests. Only when user is done and submits would you send request and do server calculations are required.

alenabdula left a reply on Best Practice For Calculations

I wouldn't do any calculations on the client side unless it enhances the user experience. So visually you can see, for example, invoice total charge when you add or remove items. But you would only submit item IDs, do the calculations in the back-end, then charge the CC or do whatever is required, and then you can return appropriate response via Http or API.

23 Jul
1 year ago
21 Jul
1 year ago

alenabdula left a reply on Can Not Pass Data From Root To First Child Component

What have you tried?

You can pass the data as a prop. <example :data="items"><\example>

items is the data on root instance and your component needs to have a props: ['data'], to accept it.

14 Jul
1 year ago

alenabdula left a reply on Start A Project With Laravel Dev Version Before Switch It To The Stable Release ?

If you're not building anything overly complex then start with the dev version. Having said that, if you're starting a client project I would suggest stable version. Next update, is not a major breaking-changes update so when it's officially out, I'm sure upgrade guide will be easy to follow.

12 Jul
1 year ago

alenabdula left a reply on Globally Include A Settings.scss With Vue-loader?

Something like this, if using SublimeText

<snippet>
<content><![CDATA[
<template>
    <div>
        ${1:<!-- template -->}
    </div>
</template>
<script>
    export default {
        ${2://}
    }
</script>
<style lang="scss">
    @import '~GlobalSass';
    ${3://}
</style>
]]></content>
<tabTrigger>vue-template</tabTrigger>
</snippet>

alenabdula left a reply on Globally Include A Settings.scss With Vue-loader?

You can create a snippet, if your editor allows it, so you're not writing template structure each time.

alenabdula left a reply on Globally Include A Settings.scss With Vue-loader?

@westwick, @gsa

// webpack.mix.js

mix.webpackConfig({
    resolve: {
        alias: {
            'GlobalSass': path.resolve('resources/assets/sass/_bootstrap.scss')
        }
    },
});
<!-- Single Vue component file -->
<template>
  <div class="component"></div>
</template>

<script>
  export default {}
</script>

<style lang="scss">
  @import '~GlobalSass';
  .component {
    color: $red;
  }
</style>

You still have to write the code to import SCSS file, but at least you don't have to mess around with ./../../../ in your code.

Hope that helps. Best, Alen.

alenabdula left a reply on Infinite Scrolling In Vue

Here's a quick and dirty example, let me know if you need me to explain any of the code... https://codepen.io/alenabdula/pen/awXzPe

Hope that helps, best Alen.

08 Jul
1 year ago

alenabdula left a reply on CSS BG Image Not Found, But Found When Clicked On Link

What does your network tab look like in the Chrome Inspector. Does it say 404 not found? Maybe it's a CSS issue, did you try using a placeholder image from online services to test it out? Could be permissions issue as well, try visiting the image URL in Incognito mode, maybe image is cached locally for you but might not work for anyone else.

Hope that helps.

alenabdula left a reply on Vue Use Vueitify

  1. Are you including CSS for vuetify, in your app.scss file you can use @import './node_modules/vuetify/dist/vuetify.min.css
  2. Are you using pre-defined components in your VueJS components, or in the HTML? https://vuetifyjs.com/layout/pre-defined

alenabdula left a reply on Laravel/Lumen Vue & PWA

While this would be awesome to have here at Laracasts. It's an enormous undertaking for Jeffery to understand everything about Progressive Web Apps as the scope of this site is more about Laravel sprinkled with some related technologies. Making API requests has been covered here pretty well IMO. So if you're interested in learning more, there are free resources around the web that explains it pretty well. I would start with a checklist for PWA, try to have that completed, and then see where in the road map does Laravel fit and find solutions derived from many lessons already available.

Google already provides, starter template, with Service Worker, and etc. I would modify it by removing any design/solution concept ex. Weather App, strip it to the bone, and build on top of that.

Hope that helps, best Alen.

05 Jul
1 year ago

alenabdula left a reply on Vue Says My Property Isn't Defined, But I Think It Is...?

Data is an object on the main instance of Vue. Components data is a function that returns an object.

Maybe the error is coming from somewhere else. Following code should work.

var data = {
  blah: 'Hello World!',
};

var app = new Vue({
  el: '#app',
  data: data,
});

Live example https://codepen.io/alenabdula/pen/jwprpX/

alenabdula left a reply on Vue Says My Property Isn't Defined, But I Think It Is...?

@alexandersix When template is rendered the data is not set. So this will not work <h1 class="title">People: @{{ blah }}</h1>.

Try

<h1 class="title" v-if="blah">People: @{{ blah }}</h1>

alenabdula left a reply on Laravel Mix Is Compiling Files To A Wrong Directory

Try following:

let mix = require('laravel-mix');

mix.setPublicPath('themes/default/assets/compiled');

mix.js('themes/default/assets/js/app.js', 'js');

alenabdula left a reply on Symlink Confusion: Why Does Storage:link Do This?

@JohnnyW2001

I save the full path in the database storage/example.jpg then use it as <img src="{{ asset($journal->thumbnail) }}" alt="">.

Hope that helps. Best, Alen

21 Jun
1 year ago

alenabdula left a reply on Vue Not Found Error

@djdunn15 You can view code for lesson in the episode 29

Looking at the code on GitHub your app.js contains additional code Vue.component('reply', require('./components/Reply.vue')); Does the Reply.vue file exist?

Hope that helps.

20 Jun
1 year ago

alenabdula left a reply on Vue Not Found Error

Show us your app.js file. It looks like you might be missing window.Vue = require('vue');

19 Jun
1 year ago

alenabdula left a reply on Creating Different CSS Files With Webpack

@bashy yeah I had to re-read it and noticed that as well.

@Alvaro_Garcia let us know if any of our suggestions helped

alenabdula left a reply on How Do You Determine If The Code Quality Is Good Or How Can I Write Code In Good Way?

I don't like the way my code works.

If it works, it's good enough.

Best way to improve is to work on what you have for extended time, see what gives you trouble and research how to improve it by solving for that specific issue. Don't overthink it. Keep it simple. Less code is always better, so try refactoring pieces of code that seem convoluted and are hard to understand of what's happening. Possibly, extract pieces of functionality to functions and give them names.

When you're working, for the most part code makes sense, but 4-5 months down the road even you will have hard time understanding what's happening, and it will take you some time to figure out, so comment the shit out of your code and give names to things.

Just keep building things, I'm also self-taught, and I can't tell you how many times I've coded dashboard for my blog... :)

alenabdula left a reply on Creating Different CSS Files With Webpack

Also, if you're importing CSS file not SCSS (not sure if that's messing things up), you can always just rename the CSS file to SCSS.

So _listing-1.css becomes _listing-1.scss.

Best, Alen.

alenabdula left a reply on Creating Different CSS Files With Webpack

Is my concept correct?

Are you using Chrome Dev-Tool? If you go under Sources Tab, add your project folder there, this might solve your issue. However, Laravel Mix should generate sourcemap within the CSS file, which helps locating code line numbers in SCSS files, instead of the compiled version of the file.

I've never used .styles in Laravel Mix. So not sure how that relates to sourcemapping, etc.

I'm not sure how your folder structure is, but the dependency issue might be that you're just referencing a file in a wrong location.

I would like to use the default app.scss file for the common css needed at all views. And i would like to generate another file with the specific CSS that will be used in a specific view (listing.scss).

Let's say your file structure is as: (the underscore in file names is just a convention, for files that are included, often called partials)

  • app.scss
  • listing.scss
  • _listing-1.scss
  • _listing-2.scss

Use what @bashy wrote in his original response:

mix
    .sass('resources/assets/sass/app.scss', 'public/css')
    .sass('resources/assets/sass/listing.scss', 'public/css')
;
// listing.scss
@import 'listing-1';
@import 'listing-2';

When you compile, you'll have listing.css file in your public/css folder, now all you need to do is add a link to the stytlesheet in the view that needs it. And when you're debugging, Chrome should display correct line numbers, in the SCSS file not CSS.

Hope that helps.

alenabdula left a reply on Is Laravel Over-engineered ?

This question is over-engineered.

alenabdula left a reply on Laravel 5.4. How To Automatically Compile All .scss Files In Directory (recursively) Into One Css File.

So, i should include files manually, as i want to control an order of adding css styles in my all.css.

Yes

i only need my File Watcher for synchronized compile.

Laravel Mix will automatically watch all the files you are importing. So when you save changes, it will re-compile.

alenabdula left a reply on Laravel 5.4. How To Automatically Compile All .scss Files In Directory (recursively) Into One Css File.

I would created all.scss file, import other SCSS files and just compile all.scss.

Something like this:

// `all.scss` file
@import '_variables';
@import '_functions';
@import '_mixins';
@import '_media-queries';
// etc...
const { mix } = require('laravel-mix');

mix.sass('resources/assets/sass/all.scss', 'public/css');

Hope that helps. Best, Alen.

03 Jun
1 year ago

alenabdula left a reply on Server For Multiple Front End Html Sites

@JDdesign

That works fine for laravel apps

You are wrong. The difference when modifying root is:

1 example.com 2 example.com/public

In the first, the publicly accessible folder is the example.com, and in the second the publicly accessible folder is public. If you modified the root place the index.html file in example.com folder.

I'm running multiple statis and laravel apps on my Forge account.

01 Jun
1 year ago

alenabdula left a reply on Best Approach To Use Nested Loop In Vue.js

How do you determine if product is in specific zone, and weather it's filled or not?

How are you setting the data object? Where's the data coming from? And can you modify its output?

If so, something like this would work:

var app = new Vue({
  el: '#app',
  data: {
    privates: [
      {
        zone: 'Zone 1',
        product: 'Product 1',
        content: 'Filled',
      },
      {
        zone: 'Zone 2',
        product: 'Product 2',
        content: 'Filled',
      },
      {
        zone: 'Zone 3',
        product: 'Product 3',
        content: 'Empty',
      },
    ],
  }
});
<table>
    <thead>
        <tr>
            <th>Zone</th>
            <th>Product</th>
            <th>Content</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <th>Zone</th>
            <th>Product</th>
            <th>Content</th>
        </tr>
    </tfoot>
    <tbody>
        <tr v-for="items in privates">
            <td v-for="item in items">{{ item }}</td>
        </tr>
    </tbody>
</table>

Demo: https://codepen.io/alenabdula/pen/awoJPr

alenabdula left a reply on Server For Multiple Front End Html Sites

@JDdesign Honestly, since I've signed up (launch day). I haven't looked back and I'm yet to experience an issue.

When you create a site on Forge, it will add proper paths and configuration settings for Nginx automatically. I never change any of the default settings and leave path to public. I use Git and have my GitHub setup to manage code for each project. I work locally, push changes to GitHub and deploy via Forge.

To me it sounds like it's a domain/DNS issue.

Try troubleshooting,

  • Domain registrar (place where you manage domain, like hover.com) nameservers for the domain point to DigitalOcean
  • Add domain at DigitalOcean in the network tab, pointing it to correct server
  • Add CNAME, for www version of domain, HOSTNAME: www, IS AN ALIAS OF: @
  • Add site for aforementioned domain on Forge
  • Visit domain

Hope that helps.

31 May
1 year ago

alenabdula left a reply on Server For Multiple Front End Html Sites

multiple static html sites... on Forge?

after tweaking the sites-enabled, it still gives a nginx 404.

How are you tweaking settings? Via Forge?

All you need to do is:

  • Point the domain you wish to host to DigitalOcean DNS servers
  • Go to network at DigitalOcean and add your domain, and select the server you wish to host the site on.
  • Then go to Forge and create a new site, adding the domain
  • Give it some time so DNS can propagate and visit the domain, you'll see phpinfo() default page created by Forge.

Hope that helps, Alen.

alenabdula left a reply on Vue Router, Execute Method On Main Instance

I've ended up solving this by using watch on the main instance.

const dashboard = new Vue({
    router,
    el: '#dashboard',
    data: {
        nav: {
            active: false,
        }
    },
    methods: {
        toggleNav() {
            this.nav.active = !this.nav.active;
        }
    },
    watch: {
        '$route' (to, from) {
            this.toggleNav();
        }
    }
});

Still would like some input if this is the "correct" way to do what I'm trying to achieve.

Thanks.

alenabdula started a new conversation Vue Router, Execute Method On Main Instance

Take following example of main VueJS instance:

const dashboard = new Vue({
    router,
    el: '#dashboard',
    data: {
        nav: {
            active: false,
        }
    },
    methods: {
        toggleNav() {
            this.nav.active = !this.nav.active;
        }
    }
});

Somewhere in my HTML, I have a hamburger like navigation with anchor that toggles navigation visibility.

<a href="#" class="nav-toggle" @click.prevent="toggleNav()"></a>

All works great and as expected.

Now, I would like toggleNav() to execute when clicking on a router-link element. Which loads another component.

<router-link :to="{ name: 'dashboard' }">Dashboard</router-link>

Currently, when I click on a router-link, component loads fine but navigation stays active.

Any help is appreciated.

Best, Alen.

03 May
1 year ago

alenabdula left a reply on Laravel Mix Not Properly Loading JQuery?

Try assigning jQuery

window.$ = window.jQuery = require('jquery');

alenabdula left a reply on Check Which Form Error(s) Belong To

But you can only submit one form, so whatever form you do submit errors belong to that form. How are you displaying errors? Are they inline with the input fields, or are you displaying them bellow the form?

Let's say you have two forms in two different div's, you can check which one has a element with a error class and do some logic based on that.