davy_yg

Member Since 4 Years Ago

Jakarta

Experience Points
98,530
Total
Experience

1,470 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
447
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 20
98,530 XP
May
07
4 days ago
Activity icon

Replied to Original Model Translate

2020_04_24_082008_create_newsletter_lists_table.php

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNewsletterlistsTable extends Migration
{
/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::create('newsletter_lists', function (Blueprint $table) {
        //$table->id();
        $table->increments('id');
        $table->string('first_name');
        $table->string('last_name');
        $table->string('email');
        $table->timestamps();
    });
}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::dropIfExists('newsletterlist');
}
}
Activity icon

Replied to Original Model Translate

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'axeshop.newsletterlist' doesn't exist (SQL: select count(*) as aggregate from newsletterlist where email = [email protected])

App\NewsletterList.php

	<?php

	namespace App;

	use Illuminate\Database\Eloquent\Model;

	class NewsletterList extends Model
	{
	//
	protected $table = 'newsletter_lists';
	}

It still looking for axeshop.newsletterlist table. This is strange. Other table works just fine.

Activity icon

Started a new Conversation Original Model Translate

Hello,

I created this model:

NewsletterList.php

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class NewsletterList extends Model
{
//
}

I expect that it would point me to this table --> newsletter_lists

Instead I am getting this error message:

Illuminate\Database\QueryException SQLSTATE[42S02]: Base table or view not found: 1146 Table 'axeshop.newsletterlist' doesn't exist (SQL: select count(*) as aggregate from newsletterlist where email = [email protected])

Any clue why? I thought it would works without

$protected table = 'newsletter_lists';

even with: $protected table = 'newsletter_lists';

still showing the same error message!

ref: https://stackoverflow.com/questions/30159257/base-table-or-view-not-found-1146-table-laravel-5

May
06
5 days ago
Activity icon

Replied to Incorrect Datetime Format

null

add_coupon.blade.php

Coupon Start:<br>
  <input type="text" name="coupon_start" id="datepicker" class="form-control">
  <br>

Kindda weird, it's null

Activity icon

Replied to Class 'finfo' Not Found

it's on the online server. I paid a webhosting.

Activity icon

Started a new Conversation Class 'finfo' Not Found

Symfony\Component\Debug\Exception\FatalThrowableError Class 'finfo' not found

ref: https://stackoverflow.com/questions/32811014/file-info-php-error-class-finfo-not-found-but-the-module-is-in-php-ini

For some reason when trying to send affiliate marketing email I get that error message. and cannot find the real solution to the problem.

Any clue?

Activity icon

Replied to Incorrect Datetime Format

Carbon\Exceptions\InvalidFormatException Unexpected data found. Unexpected data found. Trailing data

ref: https://laracasts.com/discuss/channels/laravel/carboncreatefromformat-exception-unexpected-data-found-data-missing

ref: https://stackoverflow.com/questions/42490101/invalid-datetime-format-1292-incorrect-datetime-value

"You need to format date like "Y-m-d H:i:s" in order to work with MySQL datetime field. "

I am using date picker and there is no time in it. Is that what causing the error?

May
05
6 days ago
Activity icon

Replied to Incorrect Datetime Format

12th May

Activity icon

Replied to Toggle Button

What is accepted means?

If I turn on the toggle it returns "on", otherwise it returns "?"

Activity icon

Started a new Conversation Incorrect Datetime Format

Looks like I am getting error on this:

	$coupon->coupon_start = $request->coupon_start;
    $coupon->coupon_end = $request->coupon_end;

ref: https://stackoverflow.com/questions/42490101/invalid-datetime-format-1292-incorrect-datetime-value

How to reorder the date: 05/12/2021

into: "Y-m-d H:i:s"

to match the SQL date column?

May
04
1 week ago
Activity icon

Started a new Conversation Toggle Button

Hello,

I created a toggle button to record active coupon:

add_coupon.blade.php

Coupon Active:<br>
  <label class="switch">
    <input type="checkbox" checked name="coupon_active">
    <span class="slider round"></span>
  </label>

My coupon toggle button does not pass the validation:

CouponsController.php

 $this->validate($request, [

        'coupon_name' => 'required',
        'coupon_disc' => 'integer|required',
        'coupon_min_buy' => 'integer|required',
        'coupon_start' => 'required',
        'coupon_end' => 'required',
        'coupon_active' => 'required'
    ]);

The coupon active field is required.

Any idea why?

May
03
1 week ago
Activity icon

Awarded Best Reply on Changing Xampp Php Version

I thought installing a new version of XAMPP will automatically alter the php version ? Is this true ?

See I download the XAMPP from this:

https://www.apachefriends.org/index.html

Activity icon

Replied to Mass Assignment

Call to a member function store() on null

add_product_blade.php

 	Product Main Images [Recommended: 480 x 618 pixels]

 	<input type="file" class="form-control" name="prod_main_img">

 	<br><br>

Requests\CreateProductForm.php

	'prod_main_img' => $this->file('prod_main_img')->store('public/prod_main_image'),
Activity icon

Replied to Mass Assignment

Error Call to a member function store() on null

'prod_main_img' => $this->file('post_image')->store('public/post_image'),

Activity icon

Replied to Mass Assignment

Requests\CreateProductForm.php

 public function CreateProductWithMeta()
	{

// I must not use $request

// How to write: $request->file('post_image')->store('public/post_image');
// the correct way?
Activity icon

Started a new Conversation Mass Assignment

Hello,

I am using mass assignment to insert into the database like this to get the value of id:

  $id = Product::create([
        'prod_name_en' => request('prod_name_en'),
        'prod_desc_en' => request('prod_desc_en'),
        'prod_name_id' => request('prod_name_id'),
        'prod_desc_id' => request('prod_desc_id'),
        'prod_price' => request('prod_price'), 
        'prod_weight' => request('prod_weight'),
        'prod_stock' => request('prod_stock'),

        'prod_main_img' => $request->file('post_image')->store('public/post_image');
        
        'prod_featured' => $prod_featured,
        'prod_rating' => 5,
        'prod_availability' => 1,
        'prod_seen' => 0,
    ])->id;

Now, I am having trouble to get the value of prod_main_img which has file image format.

I don't think I can do this:

$request->file('post_image')->store('public/post_image');

Since I am putting this create Product in Requests Class function.

Any clue what I should do?

Apr
15
3 weeks ago
Activity icon

Started a new Conversation Dropzone With Laravel

Hello,

I am trying to create this:

https://drive.google.com/file/d/1wr_R8u270D8O9UGBbmQ_91Q2UJLjr9d1/view?usp=sharing

dropzone using laravel. I checked the example. It is using:

https://packagist.org/packages/spatie/laravel-medialibrary

https://spatie.be/videos/discovering-laravel-media-library/introducing-laravel-media-library

My only wonder is why the front end appears is different? I expect it would look like my google drive link.

Not like this:

https://spatie.be/videos/discovering-laravel-media-library/introducing-media-library-pro

Activity icon

Started a new Conversation Storage View Error

I get an error like this:

https://drive.google.com/file/d/1GVvqJSgdRjDiAVfqO3PFtA-tlZgfVQox/view?usp=sharing

I wonder why the error is in:

storage\framework\views\e7892bdfdfe7f1bf82624b5f3a534939be4abc46.php

storage view, I already deleted all the storage views and the error still appears.

It's someone else codes that I try to run inside my laptop. The error appears after I move the whole files from xampp72 to xampp74.

I also wonder why I cannot find the highlighted code like:

<?php if($socialLink['FACEBOOK']): ?>

in any of the files besides the storage views.

Apr
14
3 weeks ago
Activity icon

Started a new Conversation Create Method

Hello,

I wonder what is the difference between:

$id = Products::create([
      'prod_name' => request('prod_name'),
      'prod_price' => request('prod_price'),
      'prod_stock' => $prod_stock,
      'prod_weight' => request('prod_weight'),
      'prod_description' => request('prod_description'),
      'prod_stockable' => $stockable,
      'prod_main_img' => request('prod_main_img'),
      'prod_featured' => $prod_featured
    ])->prod_id;

and

$prod = new Products;

$prod->prod_name = $request->prod_name;
$prod->prod_price = $request->prod_price;
$prod->prod_stock = $request->prod_stock;
$prod->prod_weight = $request->prod_weight;
$prod->prod_description = $request->prod_description;
$prod->prod_stockable = $stockable;
$prod->main_img = $request->prod_main_img;
$prod->prod_featured => $prod_featured;

$prod->save();
Mar
25
1 month ago
Activity icon

Replied to Changing Xampp Php Version

I thought installing a new version of XAMPP will automatically alter the php version ? Is this true ?

See I download the XAMPP from this:

https://www.apachefriends.org/index.html

Activity icon

Started a new Conversation Changing Xampp Php Version

Hello,

I am trying to alter my XAMPP php version, yet having a trouble in doing so.

E:\xampp74\htdocs\php -v

7.2

E:\xampp74\php\php -v

7.4

Isn't this weird ?

I expect both of them to be 7.4 since I want to install laravel 8.0

ref: https://webhostingmedia.net/update-xampp-php-version-windows/

Any clue why?

Mar
19
1 month ago
Activity icon

Started a new Conversation Dual Translation

Hello,

I am trying to create a bilingual website. I wonder what is the best way to do this?

I would like to create the translation manually to make sure that is a good translation.

What is the best way to do this?

In my mind, I would use for example for product category menu translation:

  1. id
  2. category_en (English translation)
  3. category_id (Indonesian translation)

Is this a good way to create table for bilingual translation?

Mar
17
1 month ago
Activity icon

Replied to Seeding

CategoriesSeeder.php

<?php

use Illuminate\Database\Seeder;

class CategoriesSeeder extends Seeder
{
	/**
 	* Run the database seeds.
 	*
 	* @return void
 	*/

	public function run()
	{

I did use the artisan:

php artisan make:seeder CategoriesSeeder

It does not show the namespace

Activity icon

Replied to Seeding

E:\xampp72\htdocs\axe-backend>php artisan db:seed

Illuminate\Contracts\Container\BindingResolutionException

Target class [CategoriesSeeder] does not exist.

<?php

use Illuminate\Database\Seeder; use Carbon\Carbon;

DatabaseSeeder.php

class DatabaseSeeder extends Seeder
{
/**
 * Seed the application's database.
 *
 * @return void
 */
public function run()
{
    
    $this->call(CategoriesSeeder::class);

}
}

CategoriesSeeder.php

<?php

use Illuminate\Database\Seeder;

class CategoriesSeeder extends Seeder
{
/**
 * Run the database seeds.
 *
 * @return void
 */
public function run()
{
    //

Any idea why the error appears?

Activity icon

Started a new Conversation Seeding

Hello,

I would like to how to define multiple seeder file according to each categories in different seeder file. Is that possible?

ref: https://laravel.com/docs/8.x/seeding

DatabaseSeeder.php

public function run()
{
	$this->call([
    	UserSeeder::class,
    	PostSeeder::class,
    	CommentSeeder::class,
	]);
}

How to define the PostSeeder for example?

If I use 1 seeder file DatabaseSeeder.php for the whole onlineshop it will be chaos. Therefore I want to know how to seperate search seeder file and call it at once.

Feb
25
2 months ago
Activity icon

Started a new Conversation Wishlist

Hello,

I would like to know how to alternate this two wishlist icons:

icon1 (white heart)

upon clicked it changes into icon2 (red heart)

?

Feb
11
3 months ago
Activity icon

Started a new Conversation @use Postcss-nested

Hello,

I found this tab codes that I want to implement.

ref: https://codepen.io/everdimension/pen/xZLggo?css-preprocessor=none

I copy paste the whole codes in a new folder but the codes do not work as expected.

I see this code on the top:

@use postcss-nested;

Now, how to install postcss-nested?

ref: https://www.npmjs.com/package/postcss-nesting

E:\xampp72\htdocs\ECOM_COMP\tab>npm install postcss-nesting --save-dev

	npm WARN saveError ENOENT: no such file or directory, open 'E:\xampp72\htdocs\ECOM_COMP\tab\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 'E:\xampp72\htdocs\ECOM_COMP\tab\package.json'
	npm WARN tab No description
	npm WARN tab No repository field.
	npm WARN tab No README data
	npm WARN tab No license field.

	+ [email protected]
	added 11 packages from 40 contributors and audited 11 packages in 4.057s

	1 package is looking for funding
	run `npm fund` for details

	found 0 vulnerabilities

	Do I need to install laravel for this simple web component?  I thought having these three files (html, js, css) could make the whole web works.

What's missing?

Feb
09
3 months ago
Activity icon

Replied to Bootstrap

I am using this bootstrap:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

For reason does not works. I wonder why it works on my ref?

Where did you get the bootstrap link?

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">

This one works!

ref: https://www.w3schools.com/bootstrap4/bootstrap_get_started.asp

Thanks.

Activity icon

Started a new Conversation Bootstrap

For reason I cannot understand why bootstrap does not works?

ref: https://www.w3schools.com/bootstrap/

index.php

<hr><center><b>FEATURED</b></center><hr>

 <div class="row">
	<div class="col-md-3 col-xs-3">
		<img src="images/home/fea1.jpg">
		PRODUCT 1<br>
		Rp. 325.000<br>
		<img src="images/home/stars.jpg">
	</div>
	<div class="col-md-3 col-xs-3">	
		<img src="images/home/fea2.jpg">
		PRODUCT 2<br>
		Rp. 325.000<br>
		<img src="images/home/stars.jpg">
	</div>
	<div class="col-md-3 col-xs-3">
		<img src="images/home/fea3.jpg">
		PRODUCT 3<br>
		Rp. 325.000<br>
		<img src="images/home/stars.jpg">
	</div>
	<div class="col-md-3 col-xs-3">	
		<img src="images/home/fea4.jpg">
		PRODUCT 4<br>
		Rp. 325.000<br>
		<img src="images/home/stars.jpg">
	</div>
   </div>

On mobile version, I expect the layout show 1 product in each row so it should line up vertically. But this is not the case, it cramps up all the products in row.

Any clue why?

note:

col-md-3 (for laptop size) col-xs-3 (for mobile size)

Feb
05
3 months ago
Activity icon

Started a new Conversation Laracasts Video

Where do laracasts put the video content? In laracasts server right?

It seems like laracasts video being blocked my internet provider just like vimeo. In my country they blocked all R-Rated contents.

I only wonder why including laracasts?

Activity icon

Replied to Table Doesn't Exist In Search Enginee

This is in localhost. I never create a restore point in my laptop.

Activity icon

Replied to Table Doesn't Exist In Search Enginee

For backup does *.SQL files are requirements ?

Backing up only mysql\data folder is not enough ?

Activity icon

Awarded Best Reply on Align Right

Finally solved it.

<span style="float: right"></span>
Activity icon

Replied to Align Right

Finally solved it.

<span style="float: right"></span>
Feb
04
3 months ago
Activity icon

Started a new Conversation Table Doesn't Exist In Search Enginee

For some reason after my xampp crash I backed up my data, update my phpmyadmin and my xampp fixed.

But now I got this error "Table doesn't exist in search enginee"

Any clue why?

ref: https://stackoverflow.com/questions/38759870/xampp-mysql-table-doesnt-exist-in-engine-1932/44799226

I thought backing up my folder data is enough to restore

Activity icon

Replied to Quantity Button

I already design and built the front end and almost done with it. I only need help with the minor things.

Activity icon

Replied to Quantity Button

I have taken many IT classes before. It's okay if I have to take twice as long to learn as long I reach the destination eventually. Each person just have different rewards.

Activity icon

Replied to Quantity Button

I don't want to buy the theme, my point is I want to build onlineshop from scratch, if I can do this then I can build at least 10 different kind of online shop on my own. I modify the theme to match my needs.

Activity icon

Replied to Tab

I already have bootstrap

<html>
<head>
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
</style>
Feb
03
3 months ago
Activity icon

Replied to Tab

Okay, I am taking this codes for example:

<nav>
  <div class="nav nav-tabs" id="nav-tab" role="tablist">
  <a class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Home</a>
  <a class="nav-link" id="nav-profile-tab" data-bs-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</a>
  <a class="nav-link" id="nav-contact-tab" data-bs-toggle="tab" href="#nav-contact" role="tab" aria-controls="nav-contact" aria-selected="false">Contact</a>
  </div>
 </nav>
 <div class="tab-content" id="nav-tabContent">
 <div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">...                </div>
 <div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">...</div>
 <div class="tab-pane fade" id="nav-contact" role="tabpanel" aria-labelledby="nav-contact-tab">...</div>
 </div>

Which I copy from this link:

https://getbootstrap.com/docs/5.0/components/navs-tabs/#javascript-behavior

The tab has no content even after I replace the " ... " with dummy text. Also the tab does not look like the example.

What is missing?

Activity icon

Started a new Conversation Tab

How to create tabs like the following:

https://d-themes.com/html/donald/product.html

ref:

https://www.w3schools.com/howto/howto_js_full_page_tabs.asp

I find reference but I don't how to create the underline that has length match the text above it.

Activity icon

Replied to Quantity Button

Does the button + and - button created seperately to the input box ?

Do I need javascript at all ?

Activity icon

Started a new Conversation Quantity Button

Check this quantity button on this site:

https://d-themes.com/html/donald/product.html

I wonder how to create such button?

I only know how to create button with the following codes:

	<input type="number" id="quantity" name="quantity" min="1" max="5"><br><br>
Feb
02
3 months ago
Activity icon

Started a new Conversation Align Right

Check this link:

https://drive.google.com/file/d/1BUE4YPPEoTTvBvDDtU2PaPuGkdA9m1Fn/view?usp=sharing

about.php

<div class="col-md-9">
       
       <span class="col-90">
       <span style="font-size: 16px;">About Us</span>
       </span>

       <span class="col-10">
       <img src="images\pages\home.jpg" width="30">>>&nbsp;&nbsp;About Us<br><br>
       </span>
       

       Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur interdum quis odio vel lacinia. Nulla     aliquet arcu nec neque laoreet, non euismod nisi ultricies. Donec quis posuere risus. Maecenas sed lacus id orci fermentum volutpat. Duis eu volutpat risus. Fusce egestas mi sit amet tempor interdum. Integer viverra posuere sem, eget euismod justo scelerisque eu. Donec tempor, quam varius egestas consequat, sapien purus feugiat justo, vitae viverra mauris leo vitae turpis. Sed id ante faucibus, pellentesque lacus finibus, vestibulum quam. Suspendisse sit amet mattis dui, eu rutrum magna. Mauris elementum magna ut sodales mattis. Suspendisse potenti. Aenean placerat sed arcu at iaculis. Cras at mattis ex. Duis vitae dui 			quam.<br><br>

Any clue how to align the home icon and about us breadcrumb text to the right? (I want to keep the about us title to the left)

Activity icon

Awarded Best Reply on Responsive Gray Box

I found the solution to this by adding:

.box {

width: 100%;
border: 1px solid;
border-color: #cbcbcb;
padding: 20px;

}
Activity icon

Replied to Responsive Gray Box

I found the solution to this by adding:

.box {

width: 100%;
border: 1px solid;
border-color: #cbcbcb;
padding: 20px;

}
Feb
01
3 months ago
Activity icon

Replied to Flexbox

For some reason, I cannot watch the video. There is no video appearing on the series. Any clue why?

I tried to fix the vimeo by doing this and unsuccessful:

https://www.thewindowsclub.com/vimeo-not-working-chrome-firefox

also by using google public DNS in Win 10.

https://developers.google.com/speed/public-dns

Activity icon

Started a new Conversation Responsive Gray Box

See the following pictures:

https://drive.google.com/file/d/1nu6Yl3bZkeV0hWO4K8DF0K5h1Ei-pjRN/view?usp=sharing

Around the thank you sentence and the order detail there are gray box. I wonder how to create the gray box with reponsive gray box?

Therefore, if I resize my web browser the gray box follows.