davy_yg

Experience

50,160

0 Best Reply Awards

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

7th May, 2018

davy_yg left a reply on Less Error • 2 weeks ago

I finally solved it. I forget the ;

davy_yg started a new conversation Less Error • 2 weeks ago

C:\xampp\htdocs\coolcicms\assets\less>lessc custom.less custom.css ParseError: Unrecognised input in C:\xampp\htdocs\coolcicms\assets\less\custom.less on line 63, column 7: 62 .form-control 63 width: 300px; 64 }

C:\xampp\htdocs\coolcicms\assets\less>

  • Is it possible to create the css file in different folder then the less file? For instance the css file is location in ../css relative to the less file. How to type the syntax to create the less file?

  • Next, why the below command shows some error? Should css syntax also works in less? 300 px; is being highlited in red.

davy_yg started a new conversation Less Compiler • 2 weeks ago

I wonder if sublime could detect less? Since the less file is all in one color.

I am trying to do the works in one compiler, right now I am using Sublime. Unfortunately sublime cannot compile less.

Or is there any way to make sublime able to compile less such as adding special plugin for instance?

4th May, 2018

davy_yg started a new conversation Erasing Button Depth • 2 weeks ago

I am trying to create a button but I see some depth in the button.

I am trying to erase the depth and just want to see plain box button without any depth.

This is my custom.css

.button, [type="submit"] {

    background-color: #4caf50;
    padding: 10px;
    color: white;
    cursor: pointer;
    display: inline-block;
}

I wonder why there is some depth in my button? I wonder if there is other css files (since this is from a free template) that might add to my button css files. If there is, how to erase the depth?

davy_yg left a reply on Sass • 2 weeks ago

What does this map file means?

{"version":3,"file":"../style.css","sources":["style.scss","../node_modules/bootstrap   /scss/_functions.scss","../node_modules/bootstrap/scss/_variables.scss","_variables.scss","../node_modules/compass-mixins/lib/_compass.scss","../node_modules/compass-mixins/lib/compass/_functions.scss","../

Does it mean all the *.scss files being compiled into style.css?

3rd May, 2018

davy_yg left a reply on Sass • 2 weeks ago

They have css/maps/style.css.map

{"version":3,"file":"../style.css","sources":["style.scss","../node_modules/bootstrap   /scss/_functions.scss","../node_modules/bootstrap/scss/_variables.scss","_variables.scss","../node_modules/compass-mixins/lib/_compass.scss","../node_modules/compass-mixins/lib/compass/_functions.scss","../

...

I only wonder why I cannot find the node_modules/ but the file that is being reference is still working. Since the templates looks just fine.

davy_yg started a new conversation Sass • 2 weeks ago

I downloaded a free template off the internet.

When I cek the css reference with inspect element all of them referencing *.scss

When I cek the css references:

<link rel="stylesheet" href="node_modules/mdi/css/materialdesignicons.min.css">
<link rel="stylesheet" href="node_modules/simple-line-icons/css/simple-line-icons.css">
<link rel="stylesheet" href="node_modules/flag-icon-css/css/flag-icon.min.css">
<!-- endinject -->
<!-- plugin css for this page -->
<link rel="stylesheet" href="node_modules/chartist/dist/chartist.min.css" />
<link rel="stylesheet" href="node_modules/jvectormap/jquery-jvectormap.css" />
<!-- End plugin css for this page -->
<!-- inject:css -->
<link rel="stylesheet" href="css/style.css">

I only afraid that they change the css name which is differennt from the *.scss files which is hard to trace.

davy_yg started a new conversation AppServiceProvider • 2 weeks ago

Hello,

I wonder what this is:

AppServiceProvider.php

public function boot()
    {
    Schema::defaultStringLength(191);

    view()->composer('layouts.store.store', function ($view) {
        $view->with('information', \App\SiteSetting::getInformation());
    });


    //Only for Phone
    view()->composer('store.index', function ($view) {
        $view->with('information', \App\SiteSetting::getInformation());
        $view->with('slides', \App\Advertisements::getSlides());
        $view->with('index_featured', \App\Advertisements::getIndexFeatured());
    });

I am just trying to understand someone else code.

2nd May, 2018

davy_yg started a new conversation Return Static In Model • 2 weeks ago

Hello,

I wonder they use:

return static::where('prod_featured', 1)->limit('4')->get();

What does static means? Is it refering to products table?

App/Products

class Products extends Model
{
    use SoftDeletes;

    protected $primaryKey = 'prod_id';
    protected $guarded = ['prod_id'];
    protected $dates = ['deleted_at'];


public static function get_featured()
    {
        return static::where('prod_featured', 1)->limit('4')->get();
    }

30th April, 2018

davy_yg left a reply on Random Image • 3 weeks ago

let say the column name is bank_pic and the location - localhost/eliteshop/images :

'bank_pic' => 'localhost/eliteshop/images'

Will this code create images? How do they know the image size?

If I use this code

'bank_pic' => $faker->imageUrl(100, 100),

How do they know the location of the image file? and will the images will actually be created?

29th April, 2018

davy_yg started a new conversation Rollback Migration • 3 weeks ago

Hello,

I have many tables in my databases that I migrate. When trying to rollback the migration:

C:\xampp\htdocs\eliteshop>php artisan migrate:rollback
hRolling back: 2018_04_30_034439_create_polls_table
Rolled back:  2018_04_30_034439_create_polls_table

Why only 2 tables being roll back?

davy_yg left a reply on Random Image • 3 weeks ago

I wonder if this is the only reference for seeder:

https://laravel.com/docs/5.6/seeding

I wonder how to seed integer random data or only limited integer from 1 up to 3 for example. and what about image?

Why use $faker? In the reference they use:

    DB::table('banks')->insert([            
        'bank_name' => str_random(10),
        'bank_owner' => str_random(10),
        'bank_pin' => str_random(10),
        'bank_status' => str_random(10),
    ]);

Should I put

'bank_pic' => $faker->imageUrl(100, 100),

for example?

davy_yg started a new conversation Random Image • 3 weeks ago

Is it possible to seed my database by random dummy image?

What kind of image would that be?

davy_yg left a reply on Webpack • 3 weeks ago

What's missing?

I have app.js and trial.less file in the right location.

davy_yg left a reply on Webpack • 3 weeks ago

We can compile it directly right? simply just by referencing the link.

davy_yg started a new conversation Npm Run Watch • 3 weeks ago

through npm run watch

Should we leave the cmd prompt open to keep the css file updated everytime we update the less files?

davy_yg left a reply on Webpack • 3 weeks ago

I think I already run the npm install. There is node_modules in my laravel framework.

package.json

{ "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.18", "bootstrap": "^4.0.0", "popper.js": "^1.12", "cross-env": "^5.1", "jquery": "^3.2", "laravel-mix": "^2.0", "lodash": "^4.17.4", "vue": "^2.5.7" }}

28th April, 2018

davy_yg left a reply on Webpack • 3 weeks ago

It still there:

"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

davy_yg left a reply on Webpack • 3 weeks ago

Then, I am trying to configure it:

C:\xampp\htdocs\shopee_lvl\framework>npm run dev

@ dev C:\xampp\htdocs\shopee_lvl\framework npm run development

@ development C:\xampp\htdocs\shopee_lvl\framework cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

'cross-env' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ development script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache_logs\2018-04-28T20_09_29_268Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: npm run development npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Admin\AppData\Roaming\npm-cache_logs\2018-04-28T20_09_29_346Z-debug.log

C:\xampp\htdocs\shopee_lvl\framework>

webpack.mix.js

mix.js('resources/assets/js/app.js', 'public/js')
//   .sass('resources/assets/sass/app.scss', 'public/css');
.less('resources/assets/trial.less', 'public/css');

I don't know what causing the error and I also do not see trial.css in public/css folder after running the script.

davy_yg started a new conversation Webpack • 3 weeks ago

What is web pack in Laravel?

I am in the middle of watching the Laravel mix tutorial series and still do not understand what web pack are for.

davy_yg left a reply on Sass • 3 weeks ago

I think I should read it again later.

One thing about less that just pop out of my mind: One problem - since you are creating less files instead of css files, to see them works you have to compile the file into css first which makes the process slower.

I usually create css files and see it work right away after saving it. Now, if using less file I have to compile it first before seeing it work.

davy_yg left a reply on Sass • 3 weeks ago

Looks like the map is a json file (similar format), and it has the address of the *.css

davy_yg left a reply on Less • 3 weeks ago

I think so. Thanks.

davy_yg left a reply on Less • 3 weeks ago

I see some website that has less files but do not have node_modules folders in it that I find it strange.

Do they use other compiler besides nodejs or just remove it after turning the less into css.

davy_yg started a new conversation Sass • 3 weeks ago

When you are creating a sass file and turn it into css, it creates a *.css.map file also. What is that file is for?

Is it okay if we relocate the file?

All we need is the *.scss and *.css files right?

davy_yg started a new conversation Less • 3 weeks ago

Hello,

When you are the first time trying to create a less file, you are required to install npm in the folder which will create node_modules folder.

npm install -g less

Is it okay to delete the node_modules folder? I wonder what is it for? Is it only to compile the less files into css files?

27th April, 2018

davy_yg started a new conversation Error Handler • 3 weeks ago

Hello,

I am trying to create an error handler for the user:

exceptions/handler.php

public function render($request, Exception $exception)
    {

        // This will replace our 404 response with
        // a JSON response.
            if ($exception instanceof ModelNotFoundException) {
                return response()->json([
                    'error' => 'Resource not found'
                ], 404);
        }

        return parent::render($request, $exception);
    }

Then I create an error on purpose yet the correct error message does not appears:

 InvalidArgumentException
View [here] not found.

What's wrong?

davy_yg started a new conversation Instagram API • 3 weeks ago

Hello,

I am testing the instagram api. And trying to figure out way to get the token.

It shows in this video: https://www.youtube.com/watch?v=fGMk8daxF08

By click the client ID twice it will shows me the get token form. Yet, this is not in my case. I cannot click the client ID twice. It is unclickable.

davy_yg started a new conversation API Authentication • 3 weeks ago

Hello,

I wonder what this one for?

https://laravel.com/docs/5.6/passport#installation

Is it if you want to create your own API or using the existing API like instagram API ?

24th April, 2018

davy_yg started a new conversation Closing Tab • 3 weeks ago

Hello,

What I need is not exactly a tab but look like it. Check this picture:

http://www.advance-web-studio.com/download2/

See the tab that has an "x" mark on the right corner of it?

How to create a tab like that? The tab should be closable and should comes back to normal if one refresh the screen.

davy_yg started a new conversation Npm Always Required Laravel? • 4 weeks ago

Following this tutorial: https://valor-software.com/ng2-charts/

Installing chart with npm

C:\xampp\htdocs\Aprisma>npm install ng2-charts --save npm WARN saveError ENOENT: no such file or directory, open 'C:\xampp\htdocs\Aprisma\package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open 'C:\xampp\htdocs\Aprisma\package.json' npm WARN [email protected] requires a peer of @angular/[email protected]^2.3.0 || >=4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of @angular/[email protected]^2.3.0 || >=4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN Aprisma No description npm WARN Aprisma No repository field. npm WARN Aprisma No README data npm WARN Aprisma No license field.

C:\xampp\htdocs\Aprisma>

To run npm laravel is not always required right?

davy_yg left a reply on SPA Framework • 4 weeks ago

So all Javascript framework called SPA framework?

What to turn AngularJs into spa framework?

davy_yg left a reply on SPA Framework • 4 weeks ago

Is angular a spa framework or is some other files that I need to copy to turn it into a spa framework?

davy_yg started a new conversation SPA Framework • 4 weeks ago

What is SPA framework ? and how does it relate to angular?

davy_yg started a new conversation Angular Chart • 4 weeks ago

Hello,

I am trying to create a bar chart with angular. I am following the following guidance:

https://www.fusioncharts.com/angularjs-charts/

I wonder why it does not works. I only see a blank screen when running bar_chart.html

bar_chart.html

<html>
<head>


<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="barchart_data.js"></script>
<script src="angular-fusioncharts.min.js"></script>

</head>
<body>


<fusioncharts 
        width="600" 
        height="400"
    type="column2d"
        datasource="{{myDataSource}}"
></fusioncharts>


</body>
</html>

barchart_data.js

$scope.myDataSource = {
    chart: {
        caption: "Harry's SuperMart",
        subCaption: "Top 5 stores in last month by revenue",
        numberPrefix: "$",
        theme: "ocean"
    },
    data:[{
        label: "Bakersfield Central",
        value: "880000"
    },
    {
        label: "Garden Groove harbour",
        value: "730000"
    },
    {
        label: "Los Angeles Topanga",
        value: "590000"
    },
    {
        label: "Compton-Rancho Dom",
        value: "520000"
    },
    {
        label: "Daly City Serramonte",
        value: "330000"
 }]
};

I already copy

to the same folder as bar_chart.html file.

23rd April, 2018

davy_yg left a reply on Scheduled Mail System • 4 weeks ago

lol. Where to set up the queue setting?

davy_yg left a reply on Laravel Mix • 4 weeks ago

during npm installation I get an error message mentioning that gulp util deprecated and I have to fix it using this guideline: https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

C:\xampp\htdocs\shopee_lvl\framework>npm ls gulp-util C:\xampp\htdocs\shopee_lvl\framework `-- (empty)

C:\xampp\htdocs\shopee_lvl\framework>

Can't understand why it is empty.

davy_yg started a new conversation Laravel Mix • 4 weeks ago

Hello,

I am trying to understand the laravel mix tutorial.

I already install nodejs in my pc and go to the command prompt

and to my website directory: c:/xampp/htdocs/shopee_lvl/framework

C:\xampp\htdocs\shopee_lvl>npm install laravel-mix 'npm' is not recognized as an internal or external command, operable program or batch file.

It's not working. I wonder why the npm command works in the tutorial?

22nd April, 2018

davy_yg started a new conversation Scheduled Mail System • 1 month ago

I wonder if this actually works:

https://laravel.com/docs/5.6/mail#queueing-mail

Delayed Message Queueing

If you wish to delay the delivery of a queued email message, you may use the later method. As its first argument, the later method accepts a DateTime instance indicating when the message should be sent:

$when = now()->addMinutes(10);

Mail::to($request->user()) ->cc($moreUsers) ->bcc($evenMoreUsers) ->later($when, new OrderShipped($order));

I also wonder what the queue message is for?

Mail::to($request->user()) ->cc($moreUsers) ->bcc($evenMoreUsers) ->queue($message);

Like how many email is being sent that requires the queues? and for how long between each sent email?

davy_yg started a new conversation Custom Helper • 1 month ago

When you create a folder called Helper under App and register in composer json autoload, then the helper function will be global to all right?

davy_yg started a new conversation Mailable • 1 month ago

I am trying to create an auto email when someone logins.

Mail/LoginSukses.php

class LoginSukses extends Mailable
{
    use Queueable, SerializesModels;

 /**
    * Create a new message instance.
    *
    * @return void
    */
    public function __construct()
    {
        //
    }

    /**
    * Build the message.
    *
    * @return $this
    */

public function build()
    {
        return $this->view('emails.loginsukses');
    }
}

How to call this class from the controller?

davy_yg left a reply on Cross-site Request Forgery • 1 month ago

I heard about XSS but haven't research much about CSRF. Most of the things that I know is a theory. and I have done some experiment on SQL Injection but haven't been successful yet. lol.

davy_yg left a reply on Timestamp • 1 month ago

lol. It's my client prerequisite I have to make a website that are secure. Secure login etc.

So I just have to fulfill the requirement.

davy_yg left a reply on Cross-site Request Forgery • 1 month ago

I am not completely new to security. I have learned about it before. I have learned CEH before on my own. and in the middle of taking my graduates class in MIT. They are teaching me basic IT Security. Real IT Security usually have many certificates on security, they could works in banks etc.

Anyway, that's not my real interest, I am planning to do a research for SQL Injection for my thesis. I only want to be a web developer and able to make many web projects.

davy_yg left a reply on Remember Token • 1 month ago

If the user chosen to be remembered does that means that it will automatically fill in the user information like cookie or something else.

davy_yg left a reply on Timestamp • 1 month ago

So I must use eloquent to make it works?

davy_yg left a reply on Timestamp • 1 month ago

How to retrieve the information of updated_at and created_at?

davy_yg left a reply on Cross-site Request Forgery • 1 month ago

I am in middle of learning IT security but still a beginner at it.

https://laravel.com/docs/5.6/csrf

Has the normal

{{ csrf_field()}}

changes into:

@csrf

?

davy_yg left a reply on Timestamp • 1 month ago

Really? I check it out it is empty.

It is the default thing from the Users table. Should I delete it?

davy_yg started a new conversation Cross-site Request Forgery • 1 month ago

I wonder if cross-site request forgery the same as XSS (Cross Site Script) ?

Is this enough to prevent by placing it one under every forms?

{{ csrf_field()}}

Edit Your Profile
Update

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