weiman99

weiman99

Member Since 3 Weeks Ago

Experience Points
600
Total
Experience

4,400 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

Level 1
600 XP
Feb
13
1 week ago
Activity icon

Replied to Get Data From Other Table

@sinnbeck Thanks for your reply. In my Licenses.php have this code

public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

Is this coding to make relationships?

Activity icon

Started a new Conversation Get Data From Other Table

First of all, my database has two tables which is "licenses" and "users". I have this coding which is for me to track the expiry date of the user in "licenses" table and need to send an email to that user. But the email data of the user is in the "users" table, my questions is how i get the email data from "users" to "licenses"

$key = array_rand($words);
$value = $words[$key];
$users = License::whereDate('expiry_date',DB::raw('CURDATE()'))->get();

        foreach ($users as $user) {

            Mail::raw("{$key} -> {$value}", function ($mail) use ($user) {
                $mail->from('[email protected]');
                $mail->to($user->email)
                    ->subject('Licenses expired');
            });
        }
         
        $this->info('Email sent to users who license is expired');
Feb
12
2 weeks ago
Activity icon

Replied to Send Email Notification When Date Expired

@nakov Thanks for your reply, if i want to send email when i choose a specific time and not daily or monthly? is there any references ?

Activity icon

Started a new Conversation Send Email Notification When Date Expired

Hi, I have a database column called expiry_date. When the date is expired i want to send a email. Do you guys have any suggestions and guide?Thanks

Feb
09
2 weeks ago
Activity icon

Started a new Conversation Unexpected Data Found. Unexpected Data Found. Unexpected Data Found. Trailing Data

Hey guys, i am doing email verification in my laravel project and i get some errors while i click the verify email in mailtrap.io

InvalidArgumentException
Unexpected data found.
 Unexpected data found.
 Unexpected data found.
 Trailing data
Carbon\Carbon::rawCreateFromFormat
:594
C:\xampp\htdocs\spj\vendor\nesbot\carbon\src\Carbon\Traits\Creator.php:594
Activity icon

Replied to Laravel Email Verification

@neeraj1005 My laravel version is 6.14.0, and i already follow all the step, but still got this problem

InvalidArgumentException
Unexpected data found.
 Unexpected data found.
 Unexpected data found.
 Trailing data
Feb
07
2 weeks ago
Activity icon

Replied to Laravel Email Verification

@neeraj1005 Thanks for your reply, How can i check my laravel version?

Activity icon

Started a new Conversation Laravel Email Verification

I am doing the email verification in laravel, when i Verify email address in mailstrap.oi then have some errors

InvalidArgumentException
The separation symbol could not be found
 Unexpected data found.
 Unexpected data found.
 Unexpected data found.
 Trailing data

Below is my User.php

<?php

namespace App;

use App\Notifications\VerifyUserNotification;
use Carbon\Carbon;
use Hash;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Str;
use Laravel\Passport\HasApiTokens;

class User extends Authenticatable implements MustVerifyEmail
{
    use SoftDeletes, Notifiable, HasApiTokens;

    public $table = 'users';

    protected $hidden = [
        'password',
        'remember_token',
    ];

    protected $dates = [
        'updated_at',
        'created_at',
        'deleted_at',
        'email_verified_at',
    ];

    protected $fillable = [
        'name',
        'email',
        'password',
        'approved',
        'created_at',
        'updated_at',
        'deleted_at',
        'remember_token',
        'email_verified_at',
    ];


    public function getIsAdminAttribute()
    {
        return $this->roles()->where('id', 1)->exists();
    }

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        self::created(function (User $user) {
            $registrationRole = config('panel.registration_default_role');

            if (!$user->roles()->get()->contains($registrationRole)) {
                $user->roles()->attach($registrationRole);
            }
        });
    }

    public function assignedToTasks()
    {
        return $this->hasMany(Task::class, 'assigned_to_id', 'id');
    }

    public function userCustomers()
    {
        return $this->hasMany(Customer::class, 'user_id', 'id');
    }

    public function userTimelines()
    {
        return $this->hasMany(Timeline::class, 'user_id', 'id');
    }

    public function userClients()
    {
        return $this->hasMany(Client::class, 'user_id', 'id');
    }

    public function userWorkHistories()
    {
        return $this->hasMany(WorkHistory::class, 'user_id', 'id');
    }

    public function userGovInfos()
    {
        return $this->hasMany(GovInfo::class, 'user_id', 'id');
    }

    public function userClientDetails()
    {
        return $this->hasMany(ClientDetail::class, 'user_id', 'id');
    }

    public function userCandidateDetails()
    {
        return $this->hasMany(CandidateDetail::class, 'user_id', 'id');
    }

    public function userTaskStatuses()
    {
        return $this->hasMany(TaskStatus::class, 'user_id', 'id');
    }

    public function userTaskTags()
    {
        return $this->hasMany(TaskTag::class, 'user_id', 'id');
    }

    public function userTasks()
    {
        return $this->hasMany(Task::class, 'user_id', 'id');
    }

    public function userProjects()
    {
        return $this->hasMany(Project::class, 'user_id', 'id');
    }

    public function userNotes()
    {
        return $this->hasMany(Note::class, 'user_id', 'id');
    }

    public function userDocuments()
    {
        return $this->hasMany(Document::class, 'user_id', 'id');
    }

    public function userTransactions()
    {
        return $this->hasMany(Transaction::class, 'user_id', 'id');
    }

    public function userFaqCategories()
    {
        return $this->hasMany(FaqCategory::class, 'user_id', 'id');
    }

    public function userFaqQuestions()
    {
        return $this->hasMany(FaqQuestion::class, 'user_id', 'id');
    }

    public function userTimeWorkTypes()
    {
        return $this->hasMany(TimeWorkType::class, 'user_id', 'id');
    }

    public function userTimeProjects()
    {
        return $this->hasMany(TimeProject::class, 'user_id', 'id');
    }

    public function userTimeEntries()
    {
        return $this->hasMany(TimeEntry::class, 'user_id', 'id');
    }

    public function userContactCompanies()
    {
        return $this->hasMany(ContactCompany::class, 'user_id', 'id');
    }

    public function userContactContacts()
    {
        return $this->hasMany(ContactContact::class, 'user_id', 'id');
    }

    public function userCurrencies()
    {
        return $this->hasMany(Currency::class, 'user_id', 'id');
    }

    public function userTransactionTypes()
    {
        return $this->hasMany(TransactionType::class, 'user_id', 'id');
    }

    public function userIncomeSources()
    {
        return $this->hasMany(IncomeSource::class, 'user_id', 'id');
    }

    public function userClientStatuses()
    {
        return $this->hasMany(ClientStatus::class, 'user_id', 'id');
    }

    public function userProjectStatuses()
    {
        return $this->hasMany(ProjectStatus::class, 'user_id', 'id');
    }

    public function userWorkers()
    {
        return $this->hasMany(Worker::class, 'user_id', 'id');
    }

    public function userInboxes()
    {
        return $this->hasMany(Inbox::class, 'user_id', 'id');
    }

    public function createdByCustomers()
    {
        return $this->hasMany(Customer::class, 'created_by_id', 'id');
    }

    public function createdByGovInfos()
    {
        return $this->hasMany(GovInfo::class, 'created_by_id', 'id');
    }

    public function createdByClientDetails()
    {
        return $this->hasMany(ClientDetail::class, 'created_by_id', 'id');
    }

    public function createdByTimelines()
    {
        return $this->hasMany(Timeline::class, 'created_by_id', 'id');
    }

    public function createdByWorkers()
    {
        return $this->hasMany(Worker::class, 'created_by_id', 'id');
    }

    public function userLicenses()
    {
        return $this->hasMany(License::class, 'user_id', 'id');
    }

    public function createdByLicenses()
    {
        return $this->hasMany(License::class, 'created_by_id', 'id');
    }

    public function userUserAlerts()
    {
        return $this->belongsToMany(UserAlert::class);
    }

    public function getEmailVerifiedAtAttribute($value)
    {
        return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null;
    }

    public function setEmailVerifiedAtAttribute($value)
    {
        $this->attributes['email_verified_at'] = $value ? Carbon::createFromFormat(config('panel.date_format') . ' ' . config('panel.time_format'), $value)->format('Y-m-d H:i:s') : null;
    }

    public function setPasswordAttribute($input)
    {
        if ($input) {
            $this->attributes['password'] = app('hash')->needsRehash($input) ? Hash::make($input) : $input;
        }
    }

    public function sendPasswordResetNotification($token)
    {
        $this->notify(new ResetPassword($token));
    }

    public function roles()
    {
        return $this->belongsToMany(Role::class);
    }
}
Feb
05
3 weeks ago
Activity icon

Replied to Laravel Localhost And Cpanel Problem

Yes,inside have

Activity icon

Replied to Laravel Localhost And Cpanel Problem

@ahmeddabak I already check, but i don't know correct or not.

<link href="{{ asset('css/custom.css') }}" rel="stylesheet" />
<script src="{{ asset('js/main.js') }}"></script>

Is this correct

Activity icon

Replied to Laravel Localhost And Cpanel Problem

@ahmeddabak thanks for your reply,

css

<link href="{{ asset('css/custom.css') }}" rel="stylesheet" />

js

<script src="{{ asset('js/main.js') }}"></script>

is this correct?

Activity icon

Started a new Conversation Laravel Localhost And Cpanel Problem

Hey guys, my laravel project all working good in localhost, but after i upload on cpanel have some problem there.

Localhost https://imgur.com/a/bVxerq8

Cpanel https://imgur.com/a/ou7VuNv

Activity icon

Replied to Laravel Uploaded To Cpanel

@jlrdw i already follow the guide to upload, but it become like this

https://imgur.com/a/MSMg5xB

Activity icon

Replied to Laravel Redirect Problem

@sti3bas Thanks for your reply, so what can in do now?

Activity icon

Started a new Conversation Laravel Redirect Problem

Hey guys, can help me to solve this please?

Symfony\Component\Routing\Exception\RouteNotFoundException
Route [admin.customers] not defined.

This is my route

<?php

Route::redirect('/', '/login');
Route::get('/home', function () {
    if (session('status')) {
        return redirect()->route('admin.home')->with('status', session('status'));
    }

    return redirect()->route('admin.customers');
});

Auth::routes();
// Admin

Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth']], function () {
    Route::get('/', '[email protected]')->name('home');
    Route::get('user-alerts/read', '[email protected]');
    // Permissions
    Route::delete('permissions/destroy', '[email protected]')->name('permissions.massDestroy');
    Route::resource('permissions', 'PermissionsController');

    // Roles
    Route::delete('roles/destroy', '[email protected]')->name('roles.massDestroy');
    Route::resource('roles', 'RolesController');

    // Users
    Route::delete('users/destroy', '[email protected]')->name('users.massDestroy');
    Route::resource('users', 'UsersController');

    // Audit Logs
    Route::resource('audit-logs', 'AuditLogsController', ['except' => ['create', 'store', 'edit', 'update', 'destroy']]);
Feb
04
3 weeks ago
Activity icon

Replied to Laravel Uploaded To Cpanel

After i add this line my website become Internal Server Error

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Activity icon

Started a new Conversation Laravel Uploaded To Cpanel

My laravel project in all working good in localhost,but i upload to cpanel, it show

Failed to load resource: the server responded with a status of 404 (Not Found)

Activity icon

Replied to Help

Thanks,its worked!

Activity icon

Started a new Conversation Help

can help me solve it please?

Symfony\Component\Debug\Exception\FatalThrowableError
Argument 1 passed to App\Http\Controllers\Auth\LoginController::authenticated() must be an instance of App\Http\Controllers\Auth\Request, instance of Illuminate\Http\Request given, called in /home/mediaco3/public_html/spjaya.com.my/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php on line 109
Activity icon

Replied to Database Migrate Error

Thanks, its worked

Activity icon

Replied to Database Migrate Error

<?php

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

class phpCreateRoleUserPivotTable extends Migration
{
    public function up()
    {
        Schema::create('role_user', function (Blueprint $table) {
            $table->unsignedInteger('user_id');

            $table->foreign('user_id', 'user_id_fk_833909')->references('id')->on('users')->onDelete('cascade');

            $table->unsignedInteger('role_id');

            $table->foreign('role_id', 'role_id_fk_833909')->references('id')->on('roles')->onDelete('cascade');
        });
    }
}
Activity icon

Started a new Conversation Database Migrate Error

Database migrate errors, how to solve it?

 Symfony\Component\Debug\Exception\FatalThrowableError  : Class 'CreateRoleUserPivotTable' not found

  at C:\xampp\htdocs\a\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php:448
    444|     public function resolve($file)
    445|     {
    446|         $class = Str::studly(implode('_', array_slice(explode('_', $file), 4)));
    447|
  > 448|         return new $class;
    449|     }
    450|
    451|     /**
    452|      * Get all of the migration files in a given path.

  Exception trace:

  1   Illuminate\Database\Migrations\Migrator::resolve("2020_01_17_000036_create_role_user_pivot_table")
      C:\xampp\htdocs\a\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php:186

  2   Illuminate\Database\Migrations\Migrator::runUp("C:\xampp\htdocs\a\database\migrations/2020_01_17_000036_create_role_user_pivot_table.php")
      C:\xampp\htdocs\a\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php:162

  Please use the argument -v to see more details.