mlazuardy

mlazuardy

Member Since 1 Year Ago

Bogor

Experience Points 8,430
Experience Level 2

1,570 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 12
Lessons
Completed
Best Reply Awards 0
Best Reply
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.

01 Jan
4 months ago

mlazuardy started a new conversation Group Records By 30 Minutes + Start It From 08:00 Til 07:00 ( 24 Hours )

i never meet case study like this feature, but i have a model called "Ticket", and i want to show the ticket created by 30 minutes in a day, started from 08:00, 08:30, and so on, until 07:30.

i already create a function that grouped the Tickets but it grouping by 1 hour. this is the function

public static function get_busy_hour($type = NULL, $filter = NULL){
        $sql = "SELECT Hours.Hour_num, Hours.Hour, COALESCE(total_s, 0) AS Total
        FROM
        (SELECT DATE_FORMAT(now(), '%h%p') AS Hour, DATE_FORMAT(now(), '%H') AS Hour_num
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 1 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 1 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 2 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 2 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 3 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 3 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 4 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 4 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 5 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 5 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 6 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 6 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 7 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 7 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 8 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 8 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 9 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 9 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 10 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 10 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 11 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 11 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 12 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 12 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 13 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 13 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 14 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 14 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 15 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 15 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 16 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 16 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 17 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 17 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 18 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 18 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 19 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 19 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 20 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 20 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 21 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 21 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 22 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 22 HOUR), '%H')
            UNION SELECT DATE_FORMAT(DATE_SUB(now(), INTERVAL 23 HOUR), '%h%p'), DATE_FORMAT(DATE_SUB(now(), INTERVAL 23 HOUR), '%H')
        ) AS Hours
        LEFT JOIN 
            (SELECT *, COUNT(*) AS total_s, DATE_FORMAT(created_at,'%h%p') AS Hour_j
            FROM it_tickets";

        if($type == 1){
            //date
            $date = explode("|", $filter);
            $sql .= ' WHERE created_at BETWEEN "'.date_format(date_create($date[0]), 'Y-m-d').' 00:00:00"'.' AND "'.date_format(date_create($date[1]), 'Y-m-d').' 23:59:59"';
        }
        elseif($type == 2){
            //day
            if($filter != ''){
                $sql .= ' WHERE DAYNAME(created_at) = "'.$filter.'"';
            }
        }

        $sql .= " GROUP BY HOUR(created_at)) jj ON Hours.Hour = jj.Hour_j ORDER BY Hour_num";


        $query = DB::select(DB::raw($sql));
        return $query;
    }

what is exactly need to be edit from this function to group it by 30 minutes interval in a days sorry very bad english. and thank you for answering

27 Dec
4 months ago

mlazuardy left a reply on Using Where Clause For Two Tables

@VAJID - work like a charm, thank you

mlazuardy left a reply on Using Where Clause For Two Tables

public function sale()
    {
        return $this->hasMany('App\SaleDetail', 'ticket_id');
    }

this is in Ticket Model, i'm sure that i write the relation correctly

26 Dec
4 months ago

mlazuardy left a reply on Using Where Clause For Two Tables

it turns an error @mu

Type error: Argument 2 passed to Illuminate\Database\Eloquent\Builder::whereHas() must be an instance of Closure or null, string given

mlazuardy started a new conversation Using Where Clause For Two Tables

i want to use some simple search to find repairs table and sales table, where it_repair_tables and it_sales_table have same field/column called "is_custom", so i joined the table to search repairs and sales. But, the problem is i want to display repairs and sales table when i search the "is_custom" column like "product" , where product is in repairs and tables.

my current code is like this

$ticket = $ticket->where('it_sale_details.is_custom',$data['sale_custom'])
                             ->where('it_repair_details.is_custom',$data['sale_custom']);

the $ticket variable have relationship with sales and repairs, but it just display the sale_details only. isn't including repair. how to fix this ? sorry very bad english :)

26 Nov
5 months ago

mlazuardy left a reply on Laravel HTTP Test Trying To Get Property "object" Of Undefined

@TYKUS - Thats the human error, thanks sir. Btw cannot click best answer it return 404.

mlazuardy started a new conversation Laravel HTTP Test Trying To Get Property "object" Of Undefined

I'm Using HTTP Test with PHPUnit to create test with users feature

but when i run mySampleTest like this;

  $this->get(route('users.index'))->assertStatus(200);

while the method of index like this

  $users = User::paginate(15);
        return view('users.index',compact('users'));

and the view :

<tbody>
            @foreach ($users->where('id', '!=' ,auth()->id()) as $key => $user)
            <tr>
                <td>{{$key}}</td>
                <td>{{$user->name}}</td>
                <td>{{$user->role->name}}</td>
                <td>
                    <a href="{{route('users.show',$user->id)}}">Show</a>
                </td>
                <td>
                    <a href="{{route('users.edit',$user->id)}}">Edit</a>
                </td>
                <td>
                    <form action="{{route('users.destroy',$user->id)}}" method="post">
                        @csrf
                        @method("DELETE")
                        <button type="submit" class="btn btn-danger">Delete</button>
                    </form>
                </td>
            </tr>
            @endforeach
        </tbody>

it throw an error like "trying to get property 'name' of undefined, what's the problem with my test code?

09 Nov
6 months ago
08 Nov
6 months ago

mlazuardy left a reply on Laravel Versioning ( ASK )

@D9705996 - Really Helpful, Thank You so much Master :)

mlazuardy left a reply on Laravel Versioning ( ASK )

@D9705996 - So Event I Set Cache-Control while im using laravel mix, the assets (eg. app.css and app.js) will force to reload?

mlazuardy left a reply on Laravel Versioning ( ASK )

@mlazuardy 

mlazuardy left a reply on Laravel Versioning ( ASK )

@mlazuardy 
07 Nov
6 months ago

mlazuardy left a reply on What About New Look @laracast.com

@THEUNFORGIVEN - is this UI still using Bulma ?

mlazuardy left a reply on What About New Look @laracast.com

Awe-yeah-Some, I Like the Illustration art

mlazuardy started a new conversation Laravel Versioning ( ASK )

So im using VPS to deploy my laravel apps, and using nginx as my web server. My Question is, if i cache the static assets Like This.

location ~* \.(?:css|js)$ {
  expires 1y;
  access_log off;
  add_header Cache-Control "public";
}

( including app.js and app.css from laravel mix ) and also using versioning/cache busting. is app.css and app.js will change even if it's set up like this ? Sorry bad english and Big Huge For anwering my question

03 Nov
6 months ago

mlazuardy started a new conversation Laravel Nginx PHP FPM Error, Permission Denied 13

I Have an issue while installing laravel on VPS with this error status

2018/11/03 04:10:33 [crit] 16140#16140: *8 stat() "/var/www/commit/public/index.php" failed (13: Permission denied),

can anybody help me? i guess this is a permission issue. im new using vps

13 Sep
8 months ago

mlazuardy left a reply on Login To Another Social Account While Logged In

@martinbean already have it, but when i click the link to the facebook provider . it redirect to the "/home" where the "/home" is middleware from "redirectIfAuthenticated"

mlazuardy started a new conversation Login To Another Social Account While Logged In

I have 2 Socialite driver , facebook and google. While i'm logged in with facebook. in the users setting page i want to connect with google too, but it throw to the /home again maybe because middleware. So how to connect with another social driver while in logged in ? sorry bad english. this is my LoginController

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use App\User;
use App\Jobs\SendVerificationEmail;
use Socialite;
use Auth;
use App\SocialAccount;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/@';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    public function resend()
    {
        return view('auth.resend');
    }
    /**
     * middleware jika user belum verifikasi email
     */
    protected function authenticated(Request $request,$user)
    {
        if($user->verified == 0){
            $this->guard()->logout();
            return redirect('/login')->withErrors('Akun ini belum terverifikasi, silahkan cek email anda atau kirim ulang verifikasi');
        }
    }

    public function resendEmail(Request $request)
    {
        $email = $request->email;
        $user = User::where(['verified' => 0,'email'=> $email])->first();
        if (!$user){
            return redirect('/resend')->with('error','Invalid Email or Already Verified');
        }
        $user->email_token = base64_encode($request->email);
        $user->save();
        dispatch(new SendVerificationEmail($user));
        return redirect('/resend')->with('success','Verification successfully resend to your email');

    }
    /**
     * redirect to provider
     * @param Provider
     */
    public function redirectToProvider($provider)
    {
        return Socialite::driver($provider)->redirect();
    }
    /**
     * get data from social driver
     */
    public function handleProviderCallback($provider)
    {
        $user = $this->createOrGetUser(Socialite::driver($provider)->user(),$provider);
        Auth::login($user);
        return redirect('/@')->with('success',"Sukses login melalui {$provider}");
    }
    /**
     * buat jika akun user dari provider belum terdaftar
     */
    private function createOrGetUser($providerUser, $provider)
    {
        $account = SocialAccount::where('provider', $provider)
            ->where('provider_user_id', $providerUser->getId())
            ->first();
        if ($account) {
            //return account jika ditemukan
            return $account->user;
        } else {
            //Check jika terdapat email yang sama 
            $user = User::where('email', $providerUser->getEmail())->first();
            //buat user jika tidak ada email yang terdaftar, wow lihat ada if didalam else
            if (!$user) {
                $user = User::create([
                    'username' => str_random(10),
                    'first_name' => str_random(7),
                    'last_name' => str_random(7),
                    'email' => $providerUser->getEmail(),
                    'verified' => true,
                    'password' => null
                ]);
            }
            $user->socials()->create([
                'provider_user_id' => $providerUser->getId(),
                'provider' => $provider
            ]);
            return $user;
        }
    }
}
08 Aug
9 months ago

mlazuardy left a reply on Removing Files From Request Before Passing To Controller

Try this

 if ($request->hasFile('image')) {
            unlink($image);
            $request->file('image')->store('public/blogs/' . $request->user()->id);
            $blog->image = $request->file('image')->hashName('blogs/' . $request->user()->id.'/');
        }

this is just example in update method, so configure it with your own Controller

11 Jun
11 months ago

mlazuardy left a reply on How To Display "You Need To Login First"

@aurawindsurfing i know that sir, but what i expect is showing the message in login page

mlazuardy left a reply on How To Display "You Need To Login First"

@Cronix really helpful thanks sir @Snapey just too make sure for user why they redirect to login page so i need to show the message

10 Jun
11 months ago

mlazuardy left a reply on How To Implement Settings Option In Laravel ? Like Social Link, Text Of Color, Text Of Size Etc Wan To Control By Setting ?

@Cronix Right, but if he want to configure the text size just need a config file and maybe inline styling css with dynamic value of font-size or etc. Or if he want to config and always store the configuration of user like user background-color/bg-image profile. maybe a table can handle that too

mlazuardy started a new conversation How To Display "You Need To Login First"

maybe i didnt need to show the code but my question is how to Display " You Need to login first to continue" when The Routes is protected by auth middleware in Login page ? sorry if this question is too easy for you guys. But really help and increase my knowledges

30 Apr
1 year ago

mlazuardy started a new conversation Laravel + React Native(Mobile App) Best Way To Create Authentication

For Now i guess im already completed my Web Apps Production build with Laravel, So its time to started created REST Api for Mobile apps, im using React Native and want to create authentication too with Laravel Passport , using access_token when user create or login via Mobile like this

Api\UserController.php

 public function login()
    {
        if(Auth::attempt(['email'=> request('email'),'password'=> request('password')])){
            $user = Auth::user();
            $token = $user->createToken('HMI App')->accessToken;
            $status = 200;
        }else{
            $token = 'unauthorize';
            $status = 401;
        }
        return response()->json(['token' => $token],$status);
    }

So the problem is web applications use session to store user data, whereas if not wrong mobile app use access token to save / detect user login, My question is how to save or track the user if the user is LoggedIn or Not ? what should column/or things i add to my Mobile apps using Laravel Passport ? sorry, and thanks if you want to answer guys. Happy Mayday

29 Apr
1 year ago

mlazuardy left a reply on Send Blog Subcriber With Laravel Queue Email

my current queue is database sir and you save me , thank you sir

mlazuardy started a new conversation Send Blog Subcriber With Laravel Queue Email

I want to send when my Blog already been updated to "PUBLISHED", so i create the mailable like this

<?php

namespace App\Mail;

use App\User;
use App\Blog;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendBlogNotification extends Mailable
{
    use Queueable, SerializesModels;
    public $blog;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($blog)
    {
    
        $this->blog = $blog;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('new Blog has been added')
        ->view('email.blognotification');
    }
}

and this mail is control by update method in controller named "StaffController" like this

    public function blogPublish($slug)
    {
        $blog = Blog::where('slug',$slug)->firstOrFail();
        $users = UserNotification::where('blog', 1)->get();
        $blog->status = "PUBLISHED";
        $blog->save();
        if($users){
            foreach ($users as $user) {
                Mail::to($user->user->email)->queue(new SendBlogNotification($blog));
            }
        }
        return redirect('dashboard/blog')->with('success','Blog Telah di Publish');
    }

UserNotification is 1 to 1 relationship between user and the subcribe page, when the UserNotification->blog is true, it will send the blog for blog subcriber,

for information, i already set up queue and supervisor like queue doc in laravel site ( im using ubuntu)

but when im updating blog to "published" the some of queue is failed call "SendBlogNotification has been attempted too many times or run too long. The job may have previously timed out"

what's wrong with this?

03 Apr
1 year ago

mlazuardy left a reply on Just A Question About React JS

Very right, first im split the component and also the store props to, but the when user click "add to cart" it doesnt dispatching data because the store props is different, so i use 2 Provider in 1 file, even the Provider is 2 , they have same store props so the i can dispatch the data from card to cart. but as you said, its cost performance issue and i should read that documentation from your link now.

and i think react are warning use to use the context api for intermediate js programmer,

thanks for your answer sir. i'll close this. @ejdelmonico

mlazuardy left a reply on Just A Question About React JS

you mean not recommended is cost more performance to my app ? because i have an issue to use Redux and must to save same store in order to dispatch a function.

the issue is, i have a sample project to add cart from other component ,the cart is in navbar, and the component is in Product card. So i still can't find to store and dispatch to other component. because Cart and Card, didnt have same Provider @ejdelmonico

sorry for slow response sir

22 Mar
1 year ago

mlazuardy started a new conversation Just A Question About React JS

i want to know that if i render multiple ReactDOM in same file like

 ReactDOM.render(<Example />, document.getElementById('example'));
 ReactDOM.render(<Example2 />, document.getElementById('example2'));

is it call anti-pattern or not ? or is it a bad method or not ? sorry just ask :) and thank you

11 Mar
1 year ago

mlazuardy left a reply on Laravel React Redux Internal Server Error

export function saveBlog(data){
    return dispatch => {
        return axios.post('/blog',{
            headers:{
                'Content-Type':'application/json',
            }
        }).then(response=>console.log(data));
    };
}

mlazuardy left a reply on Laravel React Redux Internal Server Error

i fixed this, forget to use the parameter data to the request

10 Mar
1 year ago

mlazuardy started a new conversation Laravel React Redux Internal Server Error

Currently i want to Increasing my skill in javascript with Laravel as a Backend, but im finding some trouble now. Im making request to Create New blog with React+Redux to manage the form request, my store Controller looks like this

BlogController


    public function store(Request $request)
    {
        $blog = new Blog([
            'title'=> $request->get('title'),
            'body' => $request->get('body'),
            'user_id' => auth()->id()
        ]);
        $blog->save();
        return response($blog,201);
    
    }

and to save the data, using actions.js and connect it to form Component

actions.js

export function saveBlog(data){
    return dispatch => {
        return axios.post('/blog',{
            headers:{
                'Content-Type':'application/json',
            }
        }).then(response=>console.log(data));
    };
}

Form.js

import React from 'react';
import uuid from 'uuid';
import {connect} from 'react-redux';
import {saveBlog} from './actions/blog-action'; 

class NewBlog extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            title:'',
            body:'',
            isLoading:false,
        };
        this.handleChange = this.handleChange.bind(this);
        this.handleSubmit = this.handleSubmit.bind(this);
    }
    handleChange(e){
        this.setState({
            [e.target.name]:e.target.value
        });
    }
    handleSubmit(e){
        e.preventDefault();
        const {title,body,user_id} = this.state;
        this.setState({isLoading:true});
        this.props.saveBlog({title,body,user_id});
        
    }
    render(){
        return(
            <div className="col-md-7" >
                <h2>New Blog</h2>
                <form onSubmit={this.handleSubmit} >
                <input type="hidden" name="_token" value={window.App.csrfToken} />
                    <div className="form-group">
                        <label htmlFor="title">Title</label>
                        <input type="text" onChange={this.handleChange}  value={this.state.title} name="title" className="form-control" />
                    </div>
                    <div className="form-group">
                        <label htmlFor="body">Body</label>
                        <textarea name="body" className="form-control" onChange={this.handleChange} value={this.state.body} cols="30" rows="10"></textarea>
                    </div>
                    <button className="btn btn-primary">{this.state.isLoading ? "Saving..." :"Save" }</button>
                </form>
            </div>
        )
    }
}
export default connect(null,{saveBlog})(NewBlog);

i dont know where im missing because its hard to see the error with Laravel+React

28 Feb
1 year ago

mlazuardy left a reply on Design A Requirement Column For Course Table [Database]

im just thinking like thar sir @bobbybouwmann @ohffs , can i Ask Relevant Question? so if i create course_requirements table. so each time i create course_requirements in forms (with javascript help to add more column to add more requirements). it will save more than 1 record data. How to save multiple data at once?

mlazuardy started a new conversation Design A Requirement Column For Course Table [Database]

I have a question, Yesterday i buy 1 course from udemy and see the "What We Learn" and "Requirement". while "what we learn" and "requirement" have 1 more than description , for example. Requirement:

  1. you must know PHP
  2. Know About Relationship
  3. bla bla bla

My question is how to design table/column like udemy for showing requirement from database? sorry if you didnt understand cause my bad english

22 Feb
1 year ago

mlazuardy left a reply on Detect Currently Connected USB[php]

i know that's my bad, this is my first site forum because cant talk in stack overflow . have a bad english. and for some reason i want to know where's the bluetooth detected in android from php code. still finding ..

mlazuardy started a new conversation Detect Currently Connected USB[php]

I dont know what the provide title should i choose but, my problem is i want to print the connected thermal printer to my android smartphone. first i test to print with linux, and the connected thermal usb printer is "dev/usb/lp0", so what i want to know is what path if i use the android smartphone ? sorry bad english

04 Feb
1 year ago

mlazuardy started a new conversation Comparison Between 2 Array [Laravel]

I Have 1 Array called " social " where this array is listing some social account from my user. I make Social controller like this

   public function socialAccount($username)
    {
        $user = $this->getUserByUsername($username);
        return view('profile.social',compact('user'));

    }

so the view will just listing the array from $username parameter, not all user, for example. My name is Michael, and I just have 1 social account called "facebook". im including 3 socialite provider . facebook, google, and github. So, Michael didnt have google and github,

even my social account is just 1, its still array so i want to make comparison. if i just have facebook social account, then the google and github status will return ` your google and github account is not activated" . So what could i do? make manual array again like

$social = ['google','github','facebook'];

?

sorry for my bad english, i hope you guys understand my problem

27 Jan
1 year ago

mlazuardy left a reply on Count All Payments Inside Table

i want to listing the payments too sir , that's why i make $payments->get(), then the sum of all nominal column, am i wrong? @ehsanquddusi

mlazuardy left a reply on Count All Payments Inside Table

Thank You Sir, i Modified A little bit to

$payments->sum('nominal');

because already declare like `$payments = Payment::get();

Really thanks :) @ehsanquddusi 

mlazuardy started a new conversation Count All Payments Inside Table

Too fast too make a question again but, this is the right time to ask something i dont know.

Well, I have a table called 'payments' and inside it, i have 1 column called nominal, where nominal is payment who pay something in my website. the nominal is store the number with bigInteger dataType to store who have pay some money for me. The Question is, how to Count all of total payments of my user payment in nominal column ? for example

user 1 had pay 500 user 2 had pay 7000 user 3 had pay 10000

and all of nominal will count and get equal = 17500.

sorry for bad english, and thank you for helping me

mlazuardy left a reply on Change Carbon Date Format

i use your 1st option sir, thanks you :) @ejdelmonico

mlazuardy started a new conversation Change Carbon Date Format

sorry if this question is simple and dumb but. How to change Carbon Date Format when i call a function/helper like $blog->created_at->toFormattedDateString() it show day first, than month and year, not month, day and year. sorry and thank you

24 Jan
1 year ago

mlazuardy left a reply on Separated Number With Comma [laravel,javascript] Inside Input Form

maybe javascript, because i want to bind the data when im start typing @satiseven777

mlazuardy started a new conversation Separated Number With Comma [laravel,javascript] Inside Input Form

So by default when I or We create an input with type number, and start typing numbers the input is'nt separate the number ( if number > 3 digit ) , for example if we type 3 million it will 3000000, so what i want inside the input field , the 3 million will seperated with comma like 3,000,000 or maybe dot .

How to do that? thank you and sorry bad english

17 Jan
1 year ago
16 Jan
1 year ago

mlazuardy started a new conversation Restrict User To Write Html Tag In Post Body

How to restrict or returning to

inside post body with markdown/Rich Text Editor? the problem is, i dont want my user to allow write html, for example. if they use <button>button</button> it will return to <p> again or something else

09 Jan
1 year ago

mlazuardy left a reply on Request WantsJson Returning To The View [laravel+vue+axios]

thanks sir oh im too fast too report this problem, its because vue axios must determine if the request wants json, I solve with this.

   mounted(){
          var config = {
              headers:{
                  'Content-Type':'application/json',
                  'Accept':'application/json'
              }
          }
          axios.get('/blog',config).then(response=>{
              this.blogs = response.data;
                console.log(response);
          }).catch(error=>{
              console.log(error);
          });
        
      },