sasafister

at Freelancer

Hire Me

Experience

30,395

4 Best Reply Awards

  • Member Since 4 Years Ago
  • 326 Lessons Completed
  • 9 Favorites

24th September, 2018

sasafister started a new conversation Courts Management DB Schema? • 3 weeks ago

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?

19th September, 2018

sasafister started a new conversation New Table Instance For Each Day In Year • 4 weeks ago

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.

16th September, 2018

sasafister left a reply on How To Add Pagination In Laravel Nova Tool? • 1 month ago

@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.

15th September, 2018

sasafister left a reply on How To Add Pagination In Laravel Nova Tool? • 1 month ago

@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

14th September, 2018

sasafister started a new conversation How To Add Pagination In Laravel Nova Tool? • 1 month ago

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?

17th August, 2018

sasafister started a new conversation Vue SPA And SEO/Crawlers • 2 months ago

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.

26th July, 2018

sasafister left a reply on Server Is Not Working When I Try To Migrate • 2 months ago

yes if i try running it it won't work

sasafister started a new conversation Server Is Not Working When I Try To Migrate • 2 months ago

alt text

29th May, 2018

sasafister left a reply on Middleware In Package • 4 months ago

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) • 4 months ago

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');

25th May, 2018

sasafister left a reply on Middleware In Package • 4 months ago

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

sasafister started a new conversation Middleware In Package • 4 months ago

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

15th May, 2018

sasafister started a new conversation Is It Smart To Have Dusk In Packages? • 5 months ago

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?

20th March, 2018

sasafister left a reply on Email Template Doesn't Show Images On Gmail • 6 months ago

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.

19th March, 2018

sasafister left a reply on Email Template Doesn't Show Images On Gmail • 6 months ago

Everything works fine now on production. Thnx guys

sasafister left a reply on Email Template Doesn't Show Images On Gmail • 6 months ago

I have this

APP_URL=http://elea.test

which works fine for Apple, but not on Gmail

sasafister left a reply on Email Template Doesn't Show Images On Gmail • 6 months ago

Thank @bobbybouwmann I will try this!

sasafister started a new conversation Email Template Doesn't Show Images On Gmail • 6 months ago

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?

13th November, 2017

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

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/,

10th September, 2017

sasafister left a reply on Router Refresh With React In Mix • 1 year ago

bump

8th September, 2017

sasafister started a new conversation Router Refresh With React In Mix • 1 year ago

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?

5th July, 2017

sasafister started a new conversation How To Fix Url Server Refresh (React) • 1 year ago

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.

8th June, 2017

sasafister left a reply on How Do You Handle Routes When Using SPA? • 1 year ago

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

sasafister left a reply on How Do You Handle Routes When Using SPA? • 1 year ago

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? • 1 year ago

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?

31st March, 2017

sasafister started a new conversation Fetching Data Without Browser? How? • 1 year ago

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?

21st October, 2016

sasafister left a reply on Using GeoIp For Fetching Location • 1 year ago

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

6th July, 2016

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

@tomo_pongrac nope, win and mac

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

@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? • 2 years ago

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?

13th January, 2016

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

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? • 2 years ago

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? • 2 years ago

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? • 2 years ago

Nope @arif still the same thing.

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

@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? • 2 years ago

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

10th January, 2016

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

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 • 2 years ago

Stil nothing, well that's weird.

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

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 • 2 years ago

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

9th January, 2016

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

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 • 2 years ago

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

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

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?

6th January, 2016

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

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

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

5th January, 2016

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

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?

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

Yes @ChristopherRaymond for now, I'am just testing the web. So the route is

public_html/ozim.info/dev/zimo_schedule_test/

and I put entire Laravel project inside this folder

sasafister started a new conversation Auth Works On My Local Env, But When I Push It On Production, It Want Login • 2 years ago

Here is my project (this is test web)

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

the problem is, everything works fine on local but I can't login on production. When I want to login it redirects me back on login page. I searched about trailing slashes, but I don't think that's the problem here. Chrome gives me reponse of

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

I tried put action with controller name in form, and rename routes so the post route for login have a different name, but this also won't work. I don't know what to do.

4th January, 2016

sasafister left a reply on Getting One Record From Array • 2 years ago

Think I figure it out. It's not prettiest thing in the world, but it get's job done. Here is what I come up with

$user->where('customer_id', Auth::user()->id)->get()[($request->author)-1]->id;

sasafister left a reply on Getting One Record From Array • 2 years ago

Thnx @JeffreyWay for help, but I what I post above is returned from

$user->where('customer_id', Auth::user()->id)->get()

so I need to somehow fetch id in the get method

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.