Loyd

Loyd

Member Since 1 Month Ago

Experience Points
1,390
Total
Experience

3,610 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
2
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.

Level 1
1,390 XP
May
26
2 days ago
Activity icon

Replied to Property [filename] Does Not Exist On This Collection Instance.

public function handle($request, Closure $next)
{
    if (auth()->check()) 

	$auth = Auth()->user()->id;
    $dost = $request->friends_id;


    $ip = DB::table('friends')

->where('my_id', '=', $auth)
    ->where('friends_id', '=', $dost)
    ->get();
  
if($ip->friends_id != $dost){
    return $next($request);
}

    endif
}
Activity icon

Replied to How To Pass A Id To The Controller Via The Route And View??

change route to

Route::post('institutes/{id}', '[email protected]_confirm')->name('delete');

form

<form action="{{ route('delete', $institute->id) }}" method="post"> 
Activity icon

Replied to Property [filename] Does Not Exist On This Collection Instance.

remove the blade syntax

if(Auth::check())

// your code here

endif
Activity icon

Replied to Too Few Arguments To Function App\Http\Controllers\CommitteeController::single()

try

Route::get('/committee/{committeeSlug}/{category}', '[email protected]');
Activity icon

Replied to Property [filename] Does Not Exist On This Collection Instance.

use

@if(Auth::check())

// your code here

@endif
Activity icon

Replied to How To Pass Auth::user()->id Using View::share('')

Try View::share(compact('staff', Auth::user()->id));

May
24
4 days ago
Activity icon

Awarded Best Reply on How Would You Create A Hasmany Relation With An Existing Database?

To create a migration, you may use the migrate:make command on the Artisan CLI. Use a specific name to avoid clashing with existinng column or table

php artisan make:migration add_exampleColumn_to_users_table --table=users

You then need to use the Schema::table() method (as you're accessing an existing table, not creating a new one). And you can add a column like this:

public function up() { Schema::table('users', function($table) { $table->unsignedBigInteger('user_id'); }); } and don't forget to add the rollback option:

public function down() { Schema::table('users', function($table) { $table->dropColumn('user_id'); }); }

Then in the User model

public function newColumn() { return $this->hasMany(anotherColumn::class); }

Then in then in the anotherColumn Model

``public function user() {

return $this->belongsTo(User::class);

}``

Then you can run your migrations:

php artisan migrate

May
23
5 days ago
Activity icon

Replied to While Installing Laravel Composer

Intsall xampp or lampp stack

Activity icon

Replied to How Would You Create A Hasmany Relation With An Existing Database?

To create a migration, you may use the migrate:make command on the Artisan CLI. Use a specific name to avoid clashing with existinng column or table

php artisan make:migration add_exampleColumn_to_users_table --table=users

You then need to use the Schema::table() method (as you're accessing an existing table, not creating a new one). And you can add a column like this:

public function up() { Schema::table('users', function($table) { $table->unsignedBigInteger('user_id'); }); } and don't forget to add the rollback option:

public function down() { Schema::table('users', function($table) { $table->dropColumn('user_id'); }); }

Then in the User model

public function newColumn() { return $this->hasMany(anotherColumn::class); }

Then in then in the anotherColumn Model

``public function user() {

return $this->belongsTo(User::class);

}``

Then you can run your migrations:

php artisan migrate

May
22
6 days ago
Activity icon

Replied to Where Are You All From?

Zimbabwe

May
21
1 week ago
Activity icon

Started a new Conversation Compiling Assets

I have a Laravel app working with a bootstrap theme, the app is quite slow. i have added my assets in the public folder. I now want make use of Laravel mix and webpack to minify my assets. How do i go about it?

Activity icon

Replied to Cannot Use Object Of Type StdClass As Array

try

@foreach($missions as $mission) <tr> <td>{{$mission->NOM}}</td> <td>{{$mission->DATE_MISSION}}</td> <td>{{$mission->ID_PER}}</td> </tr> @endforeach

Activity icon

Replied to Saving Many To Many Relationship

try

return redirect(route('tests.index')->with('success', ' Saved!');

Activity icon

Replied to How Push Form Data To Multiple Models?

its a new project let me go with the second option for now

Activity icon

Replied to Laravel- How To Pass Quantity To Navigation Bar In Multiple Pages?

You have to share your method to the view . U can do this from your AppServiceProvider on the boot function and make sure to import View and model name

<?php

namespace App\Providers;

use View;
use App\Cart;
use Illuminate\Support\ServiceProvider;


class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::share('getCartQuantity, ModelName::plus-your-trix());
    }
}
Activity icon

Awarded Best Reply on Form Field Select Option Selected But Reports Missing Value

Add an id to the select element

Activity icon

Replied to Form Field Select Option Selected But Reports Missing Value

Add an id to the select element

Activity icon

Started a new Conversation How Push Form Data To Multiple Models?

I have users table and profiles table and the 2 are related.

On the default laravel register form i have added the username field.

I want to save the username to the profiles table during user registration.

Secondly I want to edit the user fields ie name & email from the profile edit form. I will also be updating the username that is in the profiles table from that same form.

Any ideas?

Apr
04
1 month ago
Activity icon

Awarded Best Reply on How Can I Edit Table Column Settings In Production Using Laravel?

Manage to solve this by running

composer require doctrine/dbal in root directory

Activity icon

Replied to How Can I Edit Table Column Settings In Production Using Laravel?

Manage to solve this by running

composer require doctrine/dbal in root directory

Activity icon

Replied to How Can I Edit Table Column Settings In Production Using Laravel?

I ran into an issue while migrating

RuntimeException : Changing columns for table "users" requires Doctrine DBAL; install "doctrine/dbal".

at E:\1stChoice\vendor\laravel\framework\src\Illuminate\Database\Schema\Grammars\ChangeColumn.php:30 26| */ 27| public static function compile($grammar, Blueprint $blueprint, Fluent $command, Connection $connection) 28| { 29| if (! $connection->isDoctrineAvailable()) {

30| throw new RuntimeException(sprintf( 31| 'Changing columns for table "%s" requires Doctrine DBAL; install "doctrine/dbal".', 32| $blueprint->getTable() 33| )); 34| }

Exception trace:

1 Illuminate\Database\Schema\Grammars\ChangeColumn::compile(Object(Illuminate\Database\Schema\Grammars\MySqlGrammar), Object(Illuminate\Database\Schema\Blueprint), Object(Illuminate\Support\Fluent), Object(Illuminate\Database\MySqlConnection)) E:\1stChoice\vendor\laravel\framework\src\Illuminate\Database\Schema\Grammars\Grammar.php:55

2 Illuminate\Database\Schema\Grammars\Grammar::compileChange(Object(Illuminate\Database\Schema\Blueprint), Object(Illuminate\Support\Fluent), Object(Illuminate\Database\MySqlConnection)) E:\1stChoice\vendor\laravel\framework\src\Illuminate\Database\Schema\Blueprint.php:123

Please use the argument -v to see more details.

Activity icon

Replied to Redirect To Back Method Not Working

Replace return back(); With return redirect()->back();

Activity icon

Started a new Conversation How Can I Edit Table Column Settings In Production Using Laravel?

I have a laravel app in production and I now need to edit my user table password field from $table->string('password'); to $table->string('password')->nullable()->change();

So the question is how do make these changes on the users table without loosing data?