towhid

towhid

Member Since 2 Years Ago

Bangladesh

Experience Points 8,530
Experience Level 2

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 14
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.

18 Mar
2 days ago

towhid left a reply on How To Use Vue Js In Laravel Please Guide Me Or Share With Me Some References

@TYKUS - yes i do .. as like Kel_ an ia m going to him best answer for his support ..

towhid left a reply on How To Use Vue Js In Laravel Please Guide Me Or Share With Me Some References

@KEL_ - are you boring about my question ? - then think in same class there are difference type of student , some student very intelligent , and some students are very week .

then how to treat a teacher with them ?

i am not sure ? what the accurate question you want from me , last time i said - how to start vue js in laravel project .

but i got my answer - from you and many person - thanks for your reply

towhid left a reply on How To Use Vue Js In Laravel Please Guide Me Or Share With Me Some References

@TYKUS - this is my specific - question

i know laravel , i just want to start vue js use my laravel project - i hope this is some instruction make e clear thank you

towhid left a reply on How To Use Vue Js In Laravel Please Guide Me Or Share With Me Some References

@JLRDW - Hello, so you want me inform learn - Vue js from first .. simple one guide me - iwant to use laravel built in vue js -

16 Mar
4 days ago

towhid started a new conversation Whats The Difference ?

session(['message'=>'your project has been created']);
and 
session()->flash('message','your project has been created');

towhid started a new conversation What Is Main Difference In Two Sesson Data Process ?

session(['name' => 'Towhid ull alam']);
return session('name');

and

$request->session()->put('name','Towhid ull alam');
return $request->session()->get('name','default');
15 Mar
5 days ago

towhid left a reply on Call To Undefined Method Illuminate\Support\Facades\Gate::before()

I found my solution

public function boot(Gate $gate)
    {
      $this->registerPolicies();
     Gate::before(function ($user) {
        return $user->id == 1;
    });

towhid left a reply on Call To Undefined Method Illuminate\Support\Facades\Gate::before()

@MUNAZZIL - ``` Function \Auth::user()->id() does not exist

>show this error ...

towhid left a reply on Call To Undefined Method Illuminate\Support\Facades\Gate::before()

@VANDAN - ``` public function boot() { $this->registerPolicies(); Gate::define('isAdmin', function ($user) { return $user->role == 1; }); }

> i have no role field thats's why i change your fuield name 

return $user->id== 1;

> as like output same with this code and without this code

towhid left a reply on Call To Undefined Method Illuminate\Support\Facades\Gate::before()

@MUNAZZIL - this error is show

Too few arguments to function Illuminate\Auth\Access\Gate::define(), 1 passed in C:\xampp\htdocs\laravel-work\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 237 and exactly 2 expected

towhid left a reply on Call To Undefined Method Illuminate\Support\Facades\Gate::before()

@SIANGBOON - ``` // use Illuminate\Support\Facades\Gate; TO use Illuminate\Contracts\Auth\Access\Gate;

AND 

public function boot() { // dd($gate); $this->registerPolicies(); Gate::before(function($user){ return $user->id == 1; //this is admin id }); }

error this code

Non-static method Illuminate\Contracts\Auth\Access\Gate::before() cannot be called statically

towhid left a reply on Call To Undefined Method Illuminate\Support\Facades\Gate::before()

@RESIN - if i use this code

use Illuminate\Contracts\Auth\Access\Gate;

its show errror ..

Cannot use Illuminate\Contracts\Auth\Access\Gate as Gate because the name is already in use

towhid left a reply on How To Use Authentication Using Username Instead Of Email

@JLRDW - you Are 100% right - own code is better then Built in code of any functionality :)

towhid left a reply on How To Use Authentication Using Username Instead Of Email

@SNAPEY - Brilliant reference - brother :) thank you

towhid left a reply on What Is The Difference This Form Action Link ?

@CRONIX - Hello , i didn't clear from your first post , because i don't want to answer your think, i just want my answer as like my think , i hope you understand big brother . its mean i wan to clearly understand , make sure more then more time better then second time again start from first . :) you are my teacher so i hope you teach me lot of thing lots of way :) thank you

14 Mar
6 days ago

towhid started a new conversation Call To Undefined Method Illuminate\Support\Facades\Gate::before()

this is my auth service provide file code

public function boot(Gate $gate)
    {
        // dd($gate);
        $this->registerPolicies();
        $gate->before(function($user){
            return $user->id == 1; //this is admin id 
        });
    }

what the reason it show ?

towhid left a reply on What Is The Difference This Form Action Link ?

@STEREOH - i am not clear from your answer because i know one is show full link and others one only route link but my question is

it's depend on difference situation for output issue ? or any one i can use any situation ?

towhid left a reply on Foreign Key Constraint Is Incorrectly Formed

@DRAGONEYES96 - yes you are right must be follow this order for migration table

  1. user table
  2. then others table
  3. user table data type , foreign table type are same

thanks

towhid started a new conversation Foreign Key Constraint Is Incorrectly Formed

this is my user migrations table Schema

Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('email',100)->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->rememberToken();
            $table->timestamps();
        });

this is my project migration table Schema , when i using this

Schema::create('projects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('owner_id')->index();
            $table->string('title');
            $table->text('description');
            $table->timestamps();
        });

then no error show, but when i am using this line

        Schema::create('projects', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('owner_id');
            $table->string('title');
            $table->text('description');
            $table->timestamps();

            $table->foreign('owner_id')->references('id')->on('users')->onDelete('cascade');
        });

then show this error

SQLSTATE[HY000]: General error: 1005 Can't create table `laravel-work`.`#sql-2674_366` (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table `projects` add constraint `projects_owner_id_foreign` foreign key (`owner_id`) references `users` (`id`) on delete cascade)

  at C:\xampp\htdocs\laravel-work\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664
    660|         // If an exception occurs when attempting to run a query, we'll format the error
    661|         // message to include the bindings with SQL, which will make this exception a
    662|         // lot more helpful to the developer instead of just the database's errors.
    663|         catch (Exception $e) {
  > 664|             throw new QueryException(
    665|                 $query, $this->prepareBindings($bindings), $e
    666|             );
    667|         }
    668|

  Exception trace:

  1   PDOException::("SQLSTATE[HY000]: General error: 1005 Can't create table `laravel-work`.`#sql-2674_366` (errno: 150 "Foreign key constraint is incorrectly formed")")
      C:\xampp\htdocs\laravel-work\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458

  2   PDOStatement::execute()
      C:\xampp\htdocs\laravel-work\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458

towhid left a reply on What Is The Difference This Form Action Link ?

@CRONIX - i know both are works, the output's are difference

<form action="{{url('/tasks/'.$task->id)}}" method="post">
output :
<form action="http://127.0.0.1:8000/tasks/14" method="post">

and

<form action="/tasks/{{$task->id}}" method="post">
output :
<form action="/tasks/14" method="post">

it's depend on difference situation for output issue ? or any one i can use any situation ? please clear me , because of i am following again Jeffrey Video - and he used

thank you

13 Mar
1 week ago

towhid started a new conversation What Is The Difference This Form Action Link ?

<form action="{{url('/tasks/'.$task->id)}}" method="post">

or

<form action="/tasks/{{$task->id}}" method="post">

towhid left a reply on Uploading Different Types Of Files

@AKMAHATO - if you got your answer then please submit your best answer

09 Mar
1 week ago

towhid left a reply on How To Patch / Delete Method Work In Resource Controller . ?

if i - check your best answer - then its not right other person going to be wrong, so what i will do ? =-

towhid left a reply on How To Patch / Delete Method Work In Resource Controller . ?

if i want to over right then its work

Route::patch('category/{category}','[email protected]')->name('category.update');

towhid left a reply on How To Patch / Delete Method Work In Resource Controller . ?


+--------+-----------+--------------------------+------------------+-------------------------------------------------+--------------+
| Domain | Method    | URI                      | Name             | Action                                          | Middleware   |
+--------+-----------+--------------------------+------------------+-------------------------------------------------+--------------+
|        | GET|HEAD  | api/user                 |                  | Closure                                         | api,auth:api |
|        | GET|HEAD  | category                 | category.index   | App\Http\Controllers\[email protected]   | web          |
|        | POST      | category                 | category.store   | App\Http\Controllers\[email protected]   | web          |
|        | GET|HEAD  | category/create          | category.create  | App\Http\Controllers\[email protected]  | web          |
|        | GET|HEAD  | category/{category}      | category.show    | App\Http\Controllers\[email protected]    | web          |
|        | PUT|PATCH | category/{category}      | category.update  | App\Http\Controllers\[email protected]  | web          |
|        | DELETE    | category/{category}      | category.destroy | App\Http\Controllers\[email protected] | web          |
|        | GET|HEAD  | category/{category}/edit | category.edit    | App\Http\Controllers\[email protected]    | web          |
+--------+-----------+--------------------------+------------------+-------------------------------------------------+--------------+

towhid left a reply on How To Patch / Delete Method Work In Resource Controller . ?

@YEZAWHEIN - you mean need to over right the resource controller method ?

towhid started a new conversation How To Patch / Delete Method Work In Resource Controller . ?

this is my Route

Route::resource('category','CategoryController');

This is my edit form code

<form action="{{url('category')}}" method="post" name="editForm"> 
@method('patch')
@csrf

this is the error when i am going to update

The PATCH method is not supported for this route. Supported methods: GET, HEAD, POST.

Please tell me how to use delete and patch method in resource controller

towhid left a reply on Whats The Difference ? View::make('index') And View('index')

@SNAPEY - >This is useful where you want a view compiling before the end of the request. So, I use this to compile xml templates into interface files that can then be sent to another system. i don't understand .

08 Mar
1 week ago

towhid started a new conversation Whats The Difference ? View::make('index') And View('index')

View::make('index') and view('index')

towhid left a reply on Base Url

@davy_yg

why you want to use base url in your value ??

if you really want to use your base url in your value ... just use

{{url('/').$image->img_name}}

towhid left a reply on Select Option Not Working

could you tell me what you want to output with your code ? just scenario share with me . @mon

07 Mar
1 week ago

towhid left a reply on Getting Latest Entries In A Collection

$productData = new Product();
        $productData->price = $request->price;

        $productData->save();

        $lastInsertProductId = $productData->id

towhid left a reply on How To Deploy Laravel Project Directly From Github/Gitlab...?

if you want you can use giyhub or gitlab as like - others repository

create project , git init , add remote , add , commit then push and every time new chnagee you can push .

if you want work anothe rwork place then clone your gitlab project as like others project and use

composer install

and

php artisan key :generate

then start your journey again

that's it..

towhid left a reply on How To Set Condition Into Button

@ain why you dont use @if @else @endif condition ? do you have any reason ?

towhid left a reply on Base Url

@JLRDW - i think this is use only for assests call like css, image and js ***asset('') *** and action time / href / or url call ***url('') *** and naming time only ***route('') ***

towhid left a reply on How To Work My Created Sedder Class With My Factory Class

the Total solution for my Question

__ if i have Product model then__

ProductFactory.php

use Faker\Generator as Faker;
use App\Product;

$factory->define(Product::class, function (Faker $faker) {
    return [
        'productName' => $faker->word,
        'categoryId' => 2,
        'price' =>$faker-> numberBetween($min = 50, $max = 10000),
        'qty' =>$faker-> numberBetween($min = 10, $max = 100),
        'shortDescription' => $faker->text,
        'longDescription' => $faker->text,
        'pic' => 'productImage/fb.jpg',
        'publicationStatus' => 1,
    ];
});

ProductSeeder.php

use Illuminate\Database\Seeder;
use App\Product;

class ProductSeeder extends Seeder
{

    public function run()
    {
    factory(Product::class,20)->create();
    }
}

DatabaseSeeder.php

use Illuminate\Database\Seeder;
use App\Product;

class DatabaseSeeder extends Seeder
{
    public function run()
    {
        $this->call(ProductSeeder::class);

    }
}

And then command your Cmd Promt

php artisan db:seed

thank you

towhid left a reply on How To Work My Created Sedder Class With My Factory Class

@BESTMOMO - > i didnot put any code database seeder file , tell me one thign if i want others file name ProductSeeder how i will work as like database seeder class code ?

towhid left a reply on Base Url

@@davy_yg please try this process

if you want to change your base url then open your .ENV file and change your code

APP_URL=http://localhost

to 

APP_URL= ? which one you want your base url  link  // example APP_URL = http://towhid.localhost

for this base url u must be use document root process follow ..

https://www.cloudways.com/blog/configure-virtual-host-on-windows-10-for-wordpress/

    <VirtualHost *:80>
    DocumentRoot "c:/xampp/htdocs/laravel/laravel-one"
    ServerName towhid.localhost
    <Directory "c:/xampp/htdocs/laravel/laravel-one">
    </Directory>
    </VirtualHost>

127.0.0.1 localhost ::1 localhost

127.0.0.1 towhid.localhost


> after this procedure complete you must be restert your server local
then you can get your base url this syntax

{{url('/')}} http://towhid.localhost

$url = url('/') // http://towhid.localhost

towhid left a reply on How To Set Condition Into Button

@AIN - {{ $i > 0 ? ' Remove Group Member' : 'Add Group Member' }}

try this one

towhid left a reply on Which Version Of Laravel For A Fresh New Project?

laravel 5.8 is best , you just use this comand promt

composer create-project --prefer-dist laravel/laravel blog

here blog name depend on what's project name you want o use folder name

towhid left a reply on Select Option Not Working

what's the error show ?

towhid left a reply on Uploading Different Types Of Files

Search in google barryvdh/laravel-dompdf

towhid started a new conversation How To Work My Created Sedder Class

i created ProductSeeder and ProductFactory File

and run this command

ProductSeeder

use Illuminate\Database\Seeder;
use App\Product;

class ProductSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call(Product::class);
        factory(Product::class,20)->create();
    }
}

***ProductFactory

use Faker\Generator as Faker;
use App\Product;

$factory->define(Product::class, function (Faker $faker) {
    return [
        'productName' => $faker->word,
        'categoryId' => 2,
        'price' =>$faker-> numberBetween($min = 50, $max = 10000),
        'qty' =>$faker-> numberBetween($min = 10, $max = 100),
        'shortDescription' => $faker->text,
        'longDescription' => $faker->text,
        'pic' => 'productImage/fb.jpg',
        'publicationStatus' => 1,
    ];
});

and use command this line

php artisan db:seed

its not work --- and not error show also

thank you

towhid left a reply on How To Write Code In Laracast?

@CLICK - how to do this ? how to use this picture ?

towhid left a reply on How To Use Short Command For Laravel

@SAEEDPREZ - >For Windows, create a file (something like shortcuts.cmd) and add the following..

@ECHO OFF

doskey pa=php artisan $*

its not work