towhid

towhid

Member Since 2 Years Ago

Bangladesh

Experience Points 9,040
Experience Level 2

960 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 15
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.

21 May
18 hours ago

towhid left a reply on Want To Disable This Method In Form Request Validation File

@SERGIU17 - ``` public function save(ProjectCreate $request) { // $data = $this->validateProjectData($request); $data = $request->validate(); Project::create($data); return back(); }

towhid started a new conversation Want To Disable This Method In Form Request Validation File

this is my form request validation after add this validation rules and message and authorize i face one error how to solve

//this is my form request validation  code

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ProjectCreate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => ['required','unique:projects'],
            'description' => ['required'],
        ];
    }

    public function messages()
    {
        return [
            'title.required' => 'A title is required mustbe ,please fill up the message',
            'title.required' => 'A description khub dorkar',
        ];
    }
}

show this error

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
Too few arguments to function App\Http\Requests\ProjectCreate::Illuminate\Foundation\Providers\{closure}(), 0 passed and exactly 1 expected

16 May
5 days ago

towhid started a new conversation With Out Declaration In Authservice Provider Is It Work Policy Authorization ?

'App\Project'=>'App\Policies\ProjectPolicy',

is it work if any function call or metthod call ?

in projectpolicy file

   public function view(User $user, Project $project)
    {
        return  $project->user_id == $user->id;
    }

in projectController file

 public function view(Project $project)
    {

        $this->authorize('view', $project);
        return view('project.view')->withProject($project);
    }

30 Apr
3 weeks ago

towhid left a reply on Where The Default Auth Route List Called In Laravel 5.8 [ File Name]

@SERGIU17 - thank you

\vendor\laravel\framework\src\Illuminate\Routing\Router.php

this is update - path

towhid started a new conversation Where The Default Auth Route List Called

where can i find this route laravel 5.8

`` $this->get('login', 'Auth\[email protected]')->name('login'); $this->post('login', 'Auth\[email protected]'); $this->post('logout', 'Auth\[email protected]')->name('logout');

// Registration Routes... $this->get('register', 'Auth\[email protected]')->name('register'); $this->post('register', 'Auth\[email protected]');

// Password Reset Routes... $this->get('password/reset', 'Auth\[email protected]'); $this->post('password/email', 'Auth\[email protected]'); $this->get('password/reset/{token}', 'Auth\[email protected]'); $this->post('password/reset', 'Auth\[email protected]');

27 Apr
3 weeks ago

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@PHPHUPPTECHNOLOGIES - use this existing user's migrations table

$table->string('level',255)->nullable();

then migrate and use make:auth command, then create middle ware use this code

public function handle($request, Closure $next, $level1, $level2 = null, $level3 = null)
    {
        if (Auth::user() &&  Auth::user()->level == $level1) {
            return $next($request);
        } elseif(Auth::user() && $level2 != null && Auth::user()->level == $level2) {
            return $next($request);
        } elseif(Auth::user() && $level3 != null && Auth::user()->level == $level3) {
            return $next($request);
        } else {
            return response()->view('accessDenied.404');
        }
    }

and use this code fro route

Route::group(['middleware' => ['CheckLevel:level1']], function() {
    /****Level1 Route****/
    Route::get('level1','[email protected]');        
});
Route::group(['middleware' => ['CheckLevel:level2']], function() {
    /****Level2 Route****/
    Route::get('level2','[email protected]');        
});
Route::group(['middleware' => ['CheckLevel:level1,level2']], function() {
    /****Level1and level2 mix Route****/
    Route::get('level1/level2','[email protected]');     
});

out put is default nothing change after add al of your instruction i think this is not accurate way because of you didnot share proper step , if you don't mind please write proper way till login panel and admin panel show

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@JLRDW - sorry if i mistakenly not make you understand , but as my need i check in google there are many type of solution like - auth.php file changes or add some driver i also try but not exactly what i was want .

authorization and authentication is my week point in laravel that's why you suggest me two chapter if i want know out of box --- r8 ? but i cannot understand and not even clear from documentation i want practically code support - that's why i am still searching - the answer .

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@PHPHUPPTECHNOLOGIES - i will update about your instruction soon - thank you

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@JLRDW - i think i cannot make you understand :/

for this thing i want learn many ways in laracasts -

if i have -- two or three or multi types user access then they have difference data field for difference user type , so how to access check or login panel , i want to use one login panel is this possible ? or need multi login panel ? for multi user type ? i just want t clear ... thank you

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@JLRDW - suggest me any practical code or video - i don't underrated what i will do for this type of action .thank you

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@cronix please suggest any references code or video i cannot understand properly https://laravel.com/docs/5.8/authorization this page . thanks

26 Apr
3 weeks ago

towhid left a reply on I Want To Create Two Types User Panel For Two Types User.

@PATROSMANIA - i don't want to use any kind of third party package , i just want to create customize All of things

towhid started a new conversation I Want To Create Two Types User Panel For Two Types User.

i want to create two types login user, one is admin and others is customer , what i will do for this scenario .

am i use laravel buitin auth ? or make manualy auth ?

please suggest me - for customize data type table -

25 Mar
1 month ago

towhid left a reply on Foreach In Blade Directive ?

what the problem what the error show and what happened if you submit this for each ?

towhid left a reply on How To Check User_id Exist And Email Not Empty At The Same Time In Laravel?

if (SchoolDetails::where('user_id',Auth::User()->id)) {
return view('frontend.schools');
 }else{
return redirect('/account')->with('error', 'Kindly update your school details first !');
18 Mar
2 months 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
2 months 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
2 months 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
2 months 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
2 months 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
2 months 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
2 months 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
2 months ago

towhid left a reply on Getting Latest Entries In A Collection

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

        $productData->save();

        $lastInsertProductId = $productData->id