Olixr

Olixr

Wisconsin

Member Since 2 Years Ago

Experience Points 34,800
Experience
Level
Lessons Completed 326
Lessons
Completed
Best Reply Awards 3
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.

20 Jan
1 year ago

Olixr left a reply on CSS, SASS And Compiling To All.css

You would move this app.css file into your resources folder. Then you can mix down css the same as you do sass.

The end result would be a generated file in the public folder of app.css.

you should keep your working style files in the resources folder and use elixir to mix them down to the final results if that is your intention.

Olixr left a reply on Sending Retrieved Code To Database Using AJAX

This is alot of code to sift through :p.

You say your injecting the code but is this in an iframe or something?

I would try someting along the lines of storing the code in the database (usually a text column) and then just pull that code on request into the content-link2.

That is unless you need an entire webpage to serve the template. however the template seems fairly simple and should work with just being stored in the DB and pulled as needed. There would be no need for the file path in the DB.

Also regarding your AJAX script. I assume this is included in the main blade file you shared above?

How are you injecting the HTML currently using the file url you have? Does the DB always start with a file url by default or is it possible to store this as code from the start?

Lastly, looking at the ajax again, you have the argument newCode in your function updateDatabase(). It doesn't seem this is being used currently? You can try passing your updating code in through this argument and then assigning the newCode in your ajax to this argument. As a note idk about the fact you have a parameter the same name as your function argument. Perhaps this causes any issue?

Olixr left a reply on Laravel Mix Webpack Error

Is this on a fresh 5.4 install or trying to add it to an existing 5.3 project?

Olixr left a reply on Sending Retrieved Code To Database Using AJAX

I'm not a javascript expert but maybe the issue lies in the scope of the variable code2. It appears you are initiating the request correctly and your controller is getting the request (hence the error).

However I do notice inside the functions you define var code2 = Perhaps try setting code2 to null outside of these functions at the beginning of your script and then just setting the value of the variable in the functions using code2 = without the var before it.

I am guessing this because you say the code2 = "" which means it is being passed but the value is null.

Just as a side note, I don't see in your code above an element with the id content-link2 Where is this element with this id? If this element doesn't exist that would also explain the null value.

Olixr left a reply on When To Use Components?

@neovive I think you are on the right path. (just my opinion of course) but that is similar to what I was doing.

I was using Bulma for a grid css (very similar to Bootstrap) just without the JS included. I started turning the components in there into their own Vue components. (i.e. modals, tabs, etc).

I found it easier for my projects to try and separate out the components into useful modules as their own that I could re-use as needed. Of course you will run into areas where you build more customized components to one area.

I even have a few instances where there are child components that make great help. (i.e. tabs component that has child tab components to handle their own specific behaviour.

However I know this is from my project that I do this. If your working on something like a SPA (single page application) you may find much more components that are closely coupled. You would also probably put more templating into the components themselves as well.

I generally keep my layouts and barebones in laravel blade files and just pull in my Vue components as needed for functionality. (i.e. a modal on this page with navigation)

Just as a rule of thumb if I find myself repeating certain elements across a page (say for example an alert/notice) I typically try to throw it into a Vue component with its functionality so that its easier to just plop into place around my project.

As always some of it comes down to personal preference and how you see fit to organize your code base. It will sort of fall into place as you get started and notice areas where you find yourself repeating sections with the same functionality where it would be much easier to drop a component in.

This is just my opinion and 2 cents. I am sure others have valuable input as well. So far this is what I have found useful as I was learning / practicing with Vue in laravel.

Olixr left a reply on How To Make Layout In Vuejs

You'll probably want to look into components and using the templates.

You can define these layout elements in your template file and use similar syntax to Laravel blade with mustache braces to insert data.

https://vuejs.org/v2/guide/components.html

Olixr left a reply on I CanĀ“t Install Laravel Mix

Perhaps trying installing the missing dependency its squawking about.

In your package.json add this to your devDependencies

    "webpack": "^2.2.0-rc.3"

or you can try to add this through the npm install --save-dev command.

https://www.npmjs.com/package/webpack

Olixr left a reply on Versioning With Mix, Manifest Does Not Exist. {but.... It Does!)

Interesting, I think I read somewhere that someone had a similar issue, but I can't find the link.

Does this compile fine if you remove .version() ?

Perhaps the error is in the versioning right now.

Olixr left a reply on Sending Retrieved Code To Database Using AJAX

If your talking about sending a variable from JS to the controller you will need to pass it as a parameter during your request.

You can do this in your AJAX request if that's what you choose or could use something like a hidden input field in your form and insert that JS variable into there. Then when you submit the form it will treat it just like any other field.

Be cautious of the hidden input though because anyone can come in and change around the values. Make sure to have proper validation as needed.

Olixr left a reply on Intervention Image Problem

Sounds like your on Windows and your forward and backward slashes are giving your troubles.

Your trying to write to a folder on windows while formatting your path like a url.

Change the F:\wamp\www\ecommerce\public/images/avatar to F:\wamp\www\ecommerce\public\images\avatar

Have a look at PHP DIRECTORY_SEPARATOR constant. Based on your machine this will either put a / or ** accordingly.

Olixr left a reply on Private Channel : Laravel Echo With Socket.io

The issue sounds like your having an authentication issue.

Are you making sure to pass the CSRF token through your request as a parameter?

Out of the box Laravel provides some scaffolding for this insertion with Vue requests. Is it possible you removed this or are doing something different?

Olixr left a reply on How Can I Install Laravel-mix In Laravel 5.3

@Xation can you share your webpack.mix.js file?

Perhaps somewhere in your configuration your importing a font it seems. Check the bootstrap.js file if your still using that as well.

I know by default Laravel imported a font or two.

19 Jan
1 year ago

Olixr left a reply on Sending Retrieved Code To Database Using AJAX

Also take a look at your laravel.log file. If your getting a 500 error there is usually pretty good hints in the log files.

Olixr left a reply on Auth Package Suggestions

You could just have a look at Laravel Passport. Its a nice oauth setup like your looking for a built pretty stable by the creator of Laravel. No need for that third-party hassle.

https://laravel.com/docs/5.3/passport

Olixr left a reply on Laravel 5.3 With Vue 2 - Module Not Found: Error: Can't Resolve 'scss'

Typically with webpack this would be the webpack.config.js file

Olixr left a reply on Lead Generation Business

I don't think this is the place for this.

Olixr left a reply on Getting Fonts To Display On My Laravel App

Take a little time to open the inspector and make sure that your styles are loading the fonts in the first place.

The next step would to be looking that they are actually being applied to the elements and not getting overridden somewhere.

It seems like you have your import mixin working for fonts.

Perhaps share a snippet of your compiled CSS file pertaining to the fonts you are having issue with and we can take a look.

Olixr left a reply on Need To Deploy Node_modules On Production As Part Of GIT And Not Use 'npm Install'

I see what your saying. I just personally have not run into this use case before thats why I was curious.

This is good info for me though as well. I expect as I dig into Vue and Echo more that I may run into a similar case.

Olixr left a reply on Fetch Model With One Particular Related Model

Might want to take a look at query scopes.

Olixr left a reply on Versioning With Mix, Manifest Does Not Exist. {but.... It Does!)

I was able to get mix working just fine on my Laravel 5.3 build with Windows.

I also had a an issue with my manifest file not being found on my first attempt.

So the issue I was having was in my configuration. I read through the docs carefully because I was having issues and made sure to update my package.json properly.

Also I attempted to do npm prune and then run npm install but this didn't work exactly right for me. So my solution was to manually delete the node_modules folder and then run npm install

Finally you said that your error was 'Unable to locate Mix file:/css/app.css. ' is your webpack.mix.js file configured correctly? Make sure you update the default 'src/css/app.css' to your 'resources/css/app.css' or whatever your trying to mix.

Lastly there is a note in the docs that you need to call mix.js() at least once in your mix file. Are you trying to compile just css without calling .js() at least once?

Olixr left a reply on How To Convert Yyyy-mm-dd Hh:mm:ss Into Yyyy-mm-dd Using Carbon

Just as suggested above.

Something along the lines of:

$date->format('Y-m-d')

Have a look at http://php.net/manual/en/function.date.php the the options to format. Standard PHP date.

Olixr left a reply on Need To Deploy Node_modules On Production As Part Of GIT And Not Use 'npm Install'

It's generally not a recommended practice to commit your node_modules directory anymore. When you run npm install there are tasks behind the scenes that node does to compile some scripts. This can differ on windows /linux / mac.

It is possible that this is the issue you are encountering.

Could I ask the reason for needing to commit this to your project base?

Olixr left a reply on Sample Auth Pages Using ReactJS And Laravel

Why don't you have a look at the React series that Jeff has provided. https://laracasts.com/series/do-you-react

You should look at some of the basics first and then look at hooking up laravel to the backend. If your looking to pass data to laravel there are multiple ways to do so.

You could submit a ajax request to the server with some parameters defined.

It's a little unclear exactly what you are looking for. If your looking to hook up the auth views laravel provides to React there isn't a lot that you'll need to do. Maybe a little extra functionality here and there but you can still submit your login via post request.

I personally have been using Vue on my projects so I don't have a example in react to share off hand.

But with a simple google search maybe this is of help: https://github.com/talyssonoc/react-laravel-example

17 Jan
1 year ago

Olixr left a reply on How Can I Install Laravel-mix In Laravel 5.3

Glad to hear! I am using this as I go through the vue series with hot module reloading. I'm a fan of the changes to mix so far.

Question, does anyone know if its possible to pull all files for a directory rather than specify each file in the folder?

i.e. mix.js('resources/assets/js', 'public/js')

Were ideally it would compile each file down to a new one.

16 Jan
1 year ago

Olixr left a reply on Laravel Mix

@justkidding96 You need to make some minor configuration updates. I don't know if your working on a fresh package or a 5.3 project. I posted a short guide on another thread about how I got laravel-mix working on my 5.3 build. https://laracasts.com/discuss/channels/elixir/how-can-i-install-laravel-mix-in-laravel-53

Olixr left a reply on How Can I Install Laravel-mix In Laravel 5.3

Here is a guide for anyone having trouble getting laravel-mix setup on a 5.3 project. I know I ran into a few bumps along the way.

  1. Update your package.json file (You can also run npm install laravel-mix) however, I found it easier to update the package file manually.

Here is what mine looks like (don't forget to add any other dependancies you are using in your personal projects.

{
  "private": true,
  "scripts": {
    "webpack": "cross-env NODE_ENV=development webpack --progress --hide-modules",
    "dev": "cross-env NODE_ENV=development webpack --watch --progress --hide-modules",
    "hmr": "cross-env NODE_ENV=development webpack-dev-server --inline --hot",
    "production": "cross-env NODE_ENV=production webpack --progress --hide-modules"
  },
  "devDependencies": {
    "axios": "^0.15.2",
    "bootstrap-sass": "^3.3.7",
    "jquery": "^3.1.0",
    "laravel-mix": "^0.4.0",
    "lodash": "^4.16.2",
    "vue": "^2.0.1",
    "vue-resource": "^1.0.3",
    "webpack": "^2.1.0-beta.28"
  }
}
  1. Clean node_modules and install new ones

Here you can use npm prune and then npm install --save-dev to clean up your node_modules and install the new ones we specified in the package.

Personally I just deleted the node_modules folder and then npm install --save-dev to get a fresh copy.

  1. Copy configuration files

Inside node_modules/laravel-mix/setup there is some example configuration files you can copy that Jeff has provided. You can do this from the terminal by running cp -r node_modules/laravel-mix/setup/** ./. You should now have a webpack.config.js and webpack.mix.js file in your project root.

  1. Configure Laravel-mix

I didn't have to change anything in the webpack.config.js file but I did update the webpack.mix.js config.

By default its set to look for a src/app.js and src/app.scss file. However these directories don't exist in my laravel project, so update those to look in the *resources/assets folder.

Here is my webpack.mix.js file:

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

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');
  1. Done!

Now if you copied my package.json scripts (which I got from Jeffs doc in github), you can run npm run dev and you should be good to go!

You can also remove the old gulp file and other gulp related things if your no longer using them. Laravel-mix is set to use webpack out of the box. Also hmr was working for me with my Vue components.

Olixr left a reply on How Can I Install Laravel-mix In Laravel 5.3

I ended up getting things working on 5.3 just fine.

Make sure to update your package.json file with new dependencies. I used webpack 2.1.0

Also if you want to edit the webpack config more, copy the webpack.config.js from node_modules/laravel-mix/setup

12 Jan
1 year ago

Olixr left a reply on How Can I Install Laravel-mix In Laravel 5.3

I was trying to do this as well and ran into issue.

I read through the docs and watched the screen cast of https://laracasts.com/series/learn-vue-2-step-by-step/episodes/23.

No luck yet.

I am still a bit stuck. Any direction would be appreciated.

Olixr left a reply on Laravel Mix Question

Last I saw in the comments Jeff said you can now do mix.sass() twice now.

Are you still having issue?