GeorgeD

Experience

3,660

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 34 Lessons Completed
  • 0 Favorites

13th May, 2017

GeorgeD left a reply on Vujs (vue-cli) + API (laravel) On The Same Domain • 2 months ago

Thank you so much... I didn't think about server configuration :))

The full solution:

  • Folder structure: app/front_end app/back_end

  • In nginx I had added: location /api { alias "/home/vagrant/Code/app/back_end/public"; try_files $uri $uri/ @api; location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME /home/vagrant/Code/app/back_end/public/index.php;

      fastcgi_intercept_errors off;
      fastcgi_buffer_size 16k;
      fastcgi_buffers 4 16k;
      fastcgi_connect_timeout 300;
      fastcgi_send_timeout 300;
      fastcgi_read_timeout 300;
    

    } } location @api { rewrite /api/(.*)$ /api/index.php?/$1 last; }

  • Also in nginx, for vue-router to work with HTML5 History Mode I had changed try_files $uri $uri/ /index.php?$query_string; in try_files $uri $uri/ /index.html; https://router.vuejs.org/en/essentials/history-mode.html

  • Result: www.domain.com -> front-end (vuejs-cli) www.domain.com/api -> back-end (laravel)

GeorgeD started a new conversation Vujs (vue-cli) + API (laravel) On The Same Domain • 2 months ago

I want to build a project with Vuejs(using vue-cli) as front-end and use Laravel for creating the API behind. A solution to the problem would be to not use vue-cli and include vue component in laravel, how Jeffrey teach in "Learn Vue 2: Step By Step" series. But I don't see any reason why the request should go through Laravel, instead just go straight to index.html file.

I want that if the user access www.domain.com it would access index.html(from vue-cli) directly. And as far as I know to get rid of OPTIONS requests the api should be accessible on exact domain www.domain.com/api.

How can I do this ?

28th February, 2017

GeorgeD started a new conversation What Should A Developer Send To The API For State And City ? • 4 months ago

In my application I have a form with Country / State(County, Region) / City. Country is a dropdown with a list of all countries. For example, if the a users select USA, the State and City are text input, if they choose other country they are dropdown. What should a developer send to the API for state and city ? I have in mind 3 options:

  1. Always send state and city as string and if the country_code isn't usa I save them as they are else if it is usa I check if the string match one of the state and city in the database (if they doesn't match return validation error if they match I save the ID)

  2. I tell user to send for USA county_id and state_id (have in API methods to get all states and cities) and for not USA send string on country and city variables.

  3. The API should accept both solution, if the country is usa if they send country_id and city_id I use that (solution2), if they are sending text in country and city I check the text(solution 1). This solution seems better but I should explain it very well in the documentation, and I don't know how professional it is for user to send something it 2 ways.

What should you think it would be better, or if you have any other solution would be great.

2nd February, 2017

GeorgeD started a new conversation Lumen Has Any Future? • 5 months ago

Now Laravel has separated routes for API, in Http\Kernel.php we can set "throttle" (which in Lumen we must copy the middleware from the internet), and other features I don't know. Lumen website wasn't updated, on the homepage you can see: "return ['version' => '5.3']" and the documentation design wasn't updated with design from laravel documentation.

Because the site wasn't updated and Laravel implements features that makes Laravel good for API, I don't see any future for Lumen.

In my vision an app would use Lumen for back-end (api.site.com), vuejs for front-end (ww.site.com), call the API from mobile app.

What do you think ?

22nd October, 2015

GeorgeD started a new conversation When I Start Vagrant I Get Irql_not_less_or_equal • 1 year ago

I have installed VirtualBox, Vagrant, I did all the steps from Laravel tutorial to use Homestead. When I run "vagrant up" comand it's start displaying information and when try to start boot the VirtualBox, I get BlueScreenOfDeath with error: irql_not_less_or_equal

The virtualization is BIOS is enabled. OS: Windows 10 Home Hardware: ASRock H97 PRO, i5 4590

If I try to install Ubuntu in VirtualBox it's works ok.

Edit Your Profile
Update

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