sasafister

sasafister

at Freelancer

Croatia

Hire Me

Member Since 5 Years Ago

Experience Points 33,965
Experience
Level
Lessons Completed 356
Lessons
Completed
Best Reply Awards 4
Best Answer
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.

15 Jan
2 days ago

sasafister started a new conversation How To Get .env Variable In Nova Package

I have package that is located in vendor folder. Package in Nova Tool and there is component. How can I fetch .env file in that /vendor/package/component? It works only if I put .env into vendor/package folder, but I want to put data in .env that is located in root of project. Anyone has an idea?

07 Jan
1 week ago

sasafister left a reply on Ecommerce Product Matching From Different Websites

@dalma That would be very nice, but none of them don't have any kind of unique identifier. I couldn't even find shop's SKU, only identifier I have is URL slug without ID.

@patricksj unfortunately I don't have UPC/MFG # or any such identifier.

@sikic this may work for few sites since they have similar titles, but not all. Most of them have title format such as "category name, size | brand" or other random tags. This would result in many false positives.

@jlrdw Yeah, I had such problems already. Within a month one web pushed redesign few times. Web response is random, sometimes contains image - sometimes does not, etc.

Thank you all for your help. I decided to use different approach to this problem so I won't use product matching. What I found and may be useful for some is enterprise grade softwares and services for such product matching - which is in my case huge overkill and too expensive.

03 Jan
2 weeks ago

sasafister started a new conversation Ecommerce Product Matching From Different Websites

I have an interesting and complex problem.

I'm scraping few websites for price comparison/monitoring app. The problem is that N websites have same product, but different title/sku/image/categories and I don't see a way how I could match product X from site A to be same (or at least 90% similar) to product from site B.

What are your thoughts?

15 Nov
2 months ago

sasafister left a reply on How Would You Approach To This Challange?

Thnx @mushood but this doesn't help me. There is some VueJs plugins but I have trouble to understand code base...

14 Nov
2 months ago

sasafister started a new conversation How Would You Approach To This Challange?

Hi community!

I'm working on an app that handles some kind of reservations by time and by court (Tennis court). I don't use tables, instead I use div's to draw table. Horizontally I have 'courts' while vertically I have 'hours'. If user clicks on one div, let's say 'court 1, 10:00h' I store that as one event. The point is, some of reservations should be for 2h and more. So I would love to create some kind of 'drag-select' which will highlight few div's, i.e. 'court 1, from 10:00 - 12:00'... After that I would store start and end to the db..

How would you approach this problem? I didn't find any similar package that I can use.

24 Sep
3 months ago

sasafister started a new conversation Courts Management DB Schema?

I'm working on so-called app for management tennis courts. Idea is:

  • the club can create courts (and name it)
  • each day of the week can have many courts (defined in first step)
  • each court can have many hours (i.e. from 7am - 12pm) every day
  • each court for each day can be reserved in time intervals from 1h

I need to create a table that lists free hours on courts. Any idea how to setup DB?

19 Sep
3 months ago

sasafister started a new conversation New Table Instance For Each Day In Year

So I want to build some kind of calendar. I want to have a new table for each day, so I can swipe through them with 'next' | 'previous' button. Each table has own dataset. Any ideas how to solve this? Currently, I am populating the database with empty data for each day, which is not so convenient.

16 Sep
4 months ago

sasafister left a reply on How To Add Pagination In Laravel Nova Tool?

@jlrdw I know that, but idea is that you see that cars in admin area, which is more like an app, then like dashboard. Hope you understand that.

15 Sep
4 months ago

sasafister left a reply on How To Add Pagination In Laravel Nova Tool?

@jlrdw when you have for example cars in company page, and you want to go through cars, and actually want to see it all in one page

14 Sep
4 months ago

sasafister started a new conversation How To Add Pagination In Laravel Nova Tool?

So the problem is that Resources have pagination out of the box, but when you use Tool as custom Resource, then you don't have pagination. Do I have to use another npm package and do it manually, or use existing one that is used in Resources?

Any idea about that?

17 Aug
5 months ago

sasafister started a new conversation Vue SPA And SEO/Crawlers

Hi everyone! I need some help and advices regarding our Vue app we just built. I know that google's crawlers understand and can read dynamic content on the site, such as Vue/Angular, but some other crawlers can't, such as facebook.

I would like to create pre-rendered/server-side generated code on my site before reaching Vue. Facebook can't read OG tags generated by vue and that causes us problems. Site does seem fast but it takes time to load all ajax content. What if google stops loading the site before all content is fetched, that will affect our SEO.

What are your suggestions for preloading the content?

I've found the: https://prerender.io/ but seems expensive on the large scale and caching may cause us some additional problems, our content is dynamic. SSR (with nuxt for example) may cause even more problems since our site content depends on the user's local storage, country, language etc.

What are your suggestions in this case?

We are using Vue 2 + Laravel 5.6 for our API.

26 Jul
5 months ago

sasafister left a reply on Server Is Not Working When I Try To Migrate

yes if i try running it it won't work

29 May
7 months ago

sasafister left a reply on Middleware In Package

I had to defined middlwareGroup, so this works now.

public function boot(Router $router)
    {
        $this->loadRoutesFrom(__DIR__.'/routes.php');
        $this->loadViewsFrom(__DIR__.'/resources/views', 'feeds');
        $this->loadMigrationsFrom(__DIR__.'/database/migrations');

        $router->middlewareGroup('admin', array(
                \App\Http\Middleware\EncryptCookies::class,
                \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
                \Illuminate\Session\Middleware\StartSession::class,
                \Illuminate\View\Middleware\ShareErrorsFromSession::class,
                \App\Http\Middleware\VerifyCsrfToken::class,
                \Illuminate\Routing\Middleware\SubstituteBindings::class,
                \App\Http\Middleware\IsAdmin::class
            )
        );


        $this->publishes([
            __DIR__.'/Stubs' => public_path('img')
        ], 'public');

    }

sasafister started a new conversation Error Not Found In View (package)

I have found that I need to import ShareErrorFromSession, but I have route defined outside of middleware group. How can I make this work?

  public function boot(Router $router)
    {
        $this->loadRoutesFrom(__DIR__.'/routes.php');
        $this->loadViewsFrom(__DIR__.'/resources/views', 'feeds');
        $this->loadMigrationsFrom(__DIR__.'/database/migrations');

        $router->middlewareGroup('admin', array(
                \App\Http\Middleware\EncryptCookies::class,
                \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
                \Illuminate\Session\Middleware\StartSession::class,
                \Illuminate\View\Middleware\ShareErrorsFromSession::class,
                \App\Http\Middleware\VerifyCsrfToken::class,
                \Illuminate\Routing\Middleware\SubstituteBindings::class,
                \App\Http\Middleware\IsAdmin::class
            )
        );


        $this->publishes([
            __DIR__.'/Stubs' => public_path('img')
        ], 'public');

    }

my routes.php

<?php

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

    Route::resource('feed_resources', 'Feed\Http\Controllers\FeedResourceController');

    Route::get('feed', 'Feed\Http\Controllers\[email protected]')->name('feed.index');
    Route::get('feed/create', 'Feed\Http\Controllers\[email protected]')->name('feed.create');
    Route::post('feed/create', 'Feed\Http\Controllers\[email protected]')->name('feed.create');
    Route::post('feed/create/store', 'Feed\Http\Controllers\[email protected]')->name('feed.store');
    Route::get('feed/published', 'Feed\Http\Controllers\[email protected]')->name('feed.published');

});


Route::get('feed', function () {
    dd('here');
})->name('front.feed');

Route::view('feed/about', 'feeds::about')->name('feed.about');

25 May
7 months ago

sasafister left a reply on Middleware In Package

Problem is that it works, but it redirects me to home page

sasafister started a new conversation Middleware In Package

I'm working on the package that has routes. One of the routes needs auth middleware. How can I achieve that in routes.php?

15 May
8 months ago

sasafister started a new conversation Is It Smart To Have Dusk In Packages?

I have a package and I want to write a test for it. Generally, I want that test covers only package because I will have multiple packages and I don't want for the test to fail because there is no package installed (I'm talking about root composer.json).

My question is.

  1. Is it ok to have vendor directory in packages (of course, I can put that folder into gitignore)
  2. Is it ok to have Dusk for every package?
20 Mar
9 months ago

sasafister left a reply on Email Template Doesn't Show Images On Gmail

I use URL::asset, or you can use shorthand asset(), but I've put ../img/image.png, so all I had to do is remove "../" and it all works fine. On my local machine it doesn't show image, because of reason mention above.

19 Mar
9 months ago

sasafister left a reply on Email Template Doesn't Show Images On Gmail

Everything works fine now on production. Thnx guys

sasafister left a reply on Email Template Doesn't Show Images On Gmail

I have this

APP_URL=http://elea.test

which works fine for Apple, but not on Gmail

sasafister started a new conversation Email Template Doesn't Show Images On Gmail

We have build subscription logic which contains email template for welcome email. When I view email on my local machine in Apple Mail, everything works fine, but when I open email on gmail (using website) then images are not showed up. I use URL::asset for fetching images from public/img folder.

Anyone has a clue how to solve this annoying issue?

13 Nov
1 year ago

sasafister started a new conversation Can't Dd() Data From Axios Post Request

I have very simple app which is build on React. I'm using axios to send post request to Laravel. Everything is working fine until when I dump request with

$data = request()->input();

when nothing is getting dumped except this JS code. Anyone knows solution?

ja<script> Sfdump = window.Sfdump || (function (doc) { var refStyle = doc.createElement('style'), rxEsc = /([.*+?^${}()|\[\]\/\])/g, idRx = /\bsf-dump-\d+-ref[012]\w+\b/,
10 Sep
1 year ago
08 Sep
1 year ago

sasafister started a new conversation Router Refresh With React In Mix

How can I fix issues with refresh. App was build on ReactJS and it works fine, but when I go to some route i.e. '/posts' and hit refresh, basically I'm hiting server request, and I want to stay on client side with that route. So what do I need is that after refreshing some route, to get React to respond on that route. Any ideas how can I do that?

05 Jul
1 year ago

sasafister started a new conversation How To Fix Url Server Refresh (React)

Obvious, that's nothing new. I have app that uses reactjs for navigating through different pages. So I want to be able to return user back to 'reactjs route' after they hit refresh. Basically, if user is on /about page and hits refresh, I want to ping react to trigger that route.

I'm using react-router 4.

08 Jun
1 year ago

sasafister left a reply on How Do You Handle Routes When Using SPA?

I will try @tykus solution and let you know guys. Thnx

sasafister left a reply on How Do You Handle Routes When Using SPA?

I got it @tykus that means, every time user refresh url it will land on index view. But i know that exist another way of doing this, so if user refresh, let say, /posts/featured it will land on that url (javascript loading).

sasafister started a new conversation How Do You Handle Routes When Using SPA?

I'm building ReactJS app with Laravel on the backend. Everything works fine, but problem is when you hit refresh after you navigate through your website. So for example, you end up on route like this

/posts/latest

This is the route that React fetches latest posts, but if I hit refresh, obvious, that route doesn't exist in Laravel routes, so it throws Exception, which is expected behavior. So how do you handle that? Do you redirect users on home page, or do you write sam JS code?

31 Mar
1 year ago

sasafister started a new conversation Fetching Data Without Browser? How?

I've created web app that parses html code and saves it into db. Problem is that my web browser/page needs to be opened so javascript can trigger request every 2minutes (I'm using basic jQuery AJAX request). I need some way to avoid browser, so that standalone web app parses data by itself. How can I do that?

21 Oct
2 years ago

sasafister left a reply on Using GeoIp For Fetching Location

@Nasir that was two years ago, I don' remember, but try to read documentation

06 Jul
2 years ago

sasafister left a reply on How To Add Name Of Developer In Each New File?

@tomo_pongrac but I need it for every file that has been created

@phpMick I use Atom for now, but guys are using different IDE's.

sasafister started a new conversation How To Add Name Of Developer In Each New File?

We are working in teams, and need to document who is working on which files. So for example, I create new model and we should have in comment on top of file something like /* Created by: sasafister */

How can i do that automatically?

13 Jan
3 years ago

sasafister left a reply on [jQuery] How To Update Id On Which I Clicked After AJAX Success?

I got it. Your code @arif was all I needed. I put

$('#numVote' + $id).html(data);

and i put

 <td id="numVote{{ $title->id }}" >{{ $title->votes }}</td>

sasafister left a reply on [jQuery] How To Update Id On Which I Clicked After AJAX Success?

Not working @arif , so ID id fine, update is tricky part

sasafister left a reply on [jQuery] How To Update Id On Which I Clicked After AJAX Success?

Okay. So, everything works fine, that means, success method is doing his job, and in database everthing is updated as supposed to be. Only thing is that I need to updated correct (clicked) row in table.

Try this one:

user: sasa@zimo.co pass: 123456

http://dev.ozim.info/zimo_schedule_test/

sasafister left a reply on [jQuery] How To Update Id On Which I Clicked After AJAX Success?

@bobbybouwmann thnx for reply, acutally, I got dyamic ID, everything works fine, but when I update data in #numVote (ajax success) then everthing is updated (I changed #numVote into .numVote)

sasafister started a new conversation [jQurey] How To Update Id On Which I Clicked After AJAX Success?

Everything works fine, except when I click "thums up" button, it always update my first row in table.

My code is on github, so you can see it there, and here is just excerpt

https://github.com/sasafister/scheduler/blob/materialdesign/resources/views/titles/index.blade.php

 var url = "{{ url("/") }}" + "/{{ Auth::user()->id }}" + "/titles"

    $("#upVote i").on("click", function() {
        $.ajax({
            type: 'POST',
            url: url + "/upvote" + "/" + this.id,
            success: function(data) {
                $('#numVote').html(data);
            }
        });
    });
```

@foreach ($titles as $title) @if($title->created_at > \Carbon\Carbon::today()) {{ \Carbon\Carbon::parse($title->time)->format('d.m.') }} {{--{{ $title->id}}--}} {{ $title->user->name }} {{ $title->title }} thumb_down {{ $title->votes }} thumb_up {!! link_to_action('TitlesController@show', 'Edit', [$customer, $title->id]) !!} @elseif($title->created_at < \Carbon\Carbon::today()) {{ \Carbon\Carbon::parse($title->time)->format('d.m.') }} {{ $title->user->name }} {{ $title->title }}

            @endif
        @endforeach
10 Jan
3 years ago

sasafister left a reply on Ajax Request 500 Error, Don't Even Hit The Route

So yeah, I figure it out. Stupid me. I was POST-ing on wrong url. I haven't registered /upvote url, and I didn't use url() to grab relative URL, but was hardcoding it. Now it's working. I thought that was some silly mistake, but that's how developement works, right :)

sasafister left a reply on Ajax Request 500 Error, Don't Even Hit The Route

Stil nothing, well that's weird.

sasafister left a reply on Ajax Request 500 Error, Don't Even Hit The Route

I'm trying to upload everything once again, but I think that token works, I will try your suggestion @mrabbani thnx

sasafister left a reply on Ajax Request 500 Error, Don't Even Hit The Route

hi @skliche i tried that but it won't work, I think that's something with nginx on server or something.

09 Jan
3 years ago

sasafister left a reply on Ajax Request 500 Error, Don't Even Hit The Route

Actually @brti route is ok, if I click on the button, it takes me to the right url

equest URL:http://dev.ozim.info/upvote/69
Request Method:POST
Status Code:500 Internal Server Error

sasafister left a reply on Ajax Request 500 Error, Don't Even Hit The Route

@renedekat I wrote it up, nothing in log files :(

sasafister started a new conversation Ajax Request 500 Error, Don't Even Hit The Route

I'm working on my app and locally everything works perfectly, but when I push project on production server, AJAX request breaks down. I have put X-CRSF token, nothing is in my log file, routes are working fine, but still getting 500 error.

Here is my AJAX code

$.ajax({
            type: 'POST',
            url: '/upvote/' + this.id,
            success: function(data) {
                $('#numVote').html(data);
            }
        });

So, I can't reach my route, even tough they exist in routes

Route::post('/upvote/{id}/', function($id) {

   $title = \App\Title::find($id);
    $title->votes = $title->votes+1;

    $title->save();

    return $title->votes;
});

Does anyone has idea what should I try?

06 Jan
3 years ago

sasafister left a reply on Auth Works On My Local Env, But When I Push It On Production, It Won't Login

I just put empty space in my action in form it worked

            {!! Form::open(['url' => ' ', 'method' => 'POST']) !!}

05 Jan
3 years ago

sasafister left a reply on Auth Works On My Local Env, But When I Push It On Production, It Won't Login

I get apsolutly nothing @ejdelmonico

I can't event hit the post route

Route::post('/', function(){

    return "something";
    
});

Chrome send back:

Request URL:http://dev.ozim.info/zimo_schedule_test
Request Method:POST
Status Code:301 Moved Permanently
Remote Address:185.58.73.38:80

then it goes to get (/) route which is fine, is this problem with trailing slashes?