towhid

towhid

Member Since 2 Years Ago

Bangladesh

Experience Points 9,900
Experience Level 2

100 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 16
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.

09 Sep
1 week ago

towhid left a reply on Big Project LARAVEL MIX Problem

hmm this is not free only this video --- and its not clearly understand in this video

07 Sep
1 week ago

towhid left a reply on Big Project LARAVEL MIX Problem

Sorry for late reply , i want to share my project senario .

i wan to use mix but there are three types css and js one is globally second is panel wise public panel , user panel , admin panel , and third is page wise css and js , i cannot understand how to use by mix , because if i use globally then ok all are supported same for full project but i don't know how to use mix for panel wise when user panel hit then use selected css - in mix .... am i make you understand ? @bobbybouwmann

04 Sep
1 week ago

towhid left a reply on Big Project LARAVEL MIX Problem

@jlrdw

Guys, I managed to figure it out. I am coming from Yii2 where you have frontend and backend directories, and everything is split. I've always created a new subdomain for the backend, which I did now as well. That's why the root was public/admin. Now I've just created a prefix 'admin' instead of a subdomain and everything works perfectly.

This is not help full - because i have one -domain and everything work single domain not sub domain -

02 Sep
2 weeks ago

towhid left a reply on Big Project LARAVEL MIX Problem

Hi , thanks for your reply - is it possible compiled separately for separate panel ? like when i hit admin panel then admin template css and js load or work -- is this possible in web pack mix .

i tried last days in one combined but its not work - i just want to know my project situation wise can i use webpack mix use in laravel ? thats is thank you

01 Sep
2 weeks ago

towhid started a new conversation Big Project LARAVEL MIX Problem

i have a scenario :

my project has 3 part layout Design -

  1. Front End
  2. User panel
  3. Admin Panel

for that i have Global css typeof panel CSS and Page wise individually internally CSS

for this reason i want to use laravel mix == but my question is if i all css [global + panel wise ] is combine in laravel webpack mix then its possible ?

and mu all of js can i use webpack mix ..

and how do i use image which one use project

27 Aug
3 weeks ago

towhid left a reply on Multi Auth Sytem Log Out Problem

OK its work perfectly - my last query is if i want to use two type auth table user and admin , and i want to use two login panel , but if any type auth person logged in no one can browse others auth access , like : i have one user logged in user panel in this time any admin or super admin hit this login page then redirect auto my user panel . please help m ,,,,eeee

11 Aug
1 month ago

towhid left a reply on Custom Create Route For A Specific Resource

just over right the code= the route code

towhid left a reply on Multi Auth Sytem Log Out Problem

@jlrdw

Edit: to add I am still confused why you want an admin and a user logged in at the same time on the same computer.

ok i forget it for same login both in same browser ..

BTW tell one thing i have Two guard one is web another id admin - can any view section show for check guard type ?

@if(Auth::gurad('admin'))
<a href="{{route('button.one')}}">button one </a>
@else
 <a href="{{route('button.two')}}">button two  </a>
@endif

is it work for guard type check process ?

10 Aug
1 month ago

towhid left a reply on Multi Auth Sytem Log Out Problem

@jlrdw

The logged in user can be stored in the same table. That's what the role is for.

i understand this thing which one you suggested : for single table one extra field where i use role type or admin type .. and i also know how to check for difference role type view section lik =e example

@if(Auth::user()->roleType == 'admin')
<a href="{{route('admin.logout')}}">admin logout </a>
@else
 <a href="{{route('logout')}}">user log out </a>
@endif

but my question is how to logout button show fro check system when i used multi type guard for multi table like i have two type auth guard one is default web and another id my customize Auth guard admin

so to do that please help me out , if its not possible for builtin auth by any overweight system then how to do ? thank you

towhid left a reply on Multi Auth Sytem Log Out Problem

@snapey

If this is the case, thats a really dumb solution. Why would you allow a user to login twice in the same browser? Thanks for your Reply = i am just following one video from you tube - where show how to make multi Auth system , so every thing is ok. login panel multi type . Auth type multi type depend on guard type ... same time browser login in multi panel . now i want to know i have now one Logout button

route('logout')

if i logout then both panel also logout - from browser ..

bu ti want when admin logout from only admin panel and if user want to logout then only logout from user panel .. so i want to know first thing , if i want to show guard wise how to code for check guard type and secondly how to do this by multi type logout system thank you

09 Aug
1 month ago

towhid left a reply on Multi Auth Sytem Log Out Problem

@jlrdw

Brother do you understand what i want to do ? == please check my last comment about my view things after that then i am not using route url then how and where i do that ?

towhid left a reply on Multi Auth Sytem Log Out Problem

@miaababikir

but i have same problem still because i create this route as like your instructon

Route::post('admin-logout', 'Admin\[email protected]')->name('admin.logout');

and in login controller i add this code

    public function adminLogout(Request $request)
    {
        $this->guard('admin')->logout();

        $request->session()->invalidate();

        return $this->loggedOut($request) ?: redirect('/admin-login');
    }

but now think i ahve two button one is user log out and other is admin log out two route two method

like


<a href="{{route('logout')}}">user log out </a>
<a href="{{route('admin.logout')}}">admin logout </a>

but now show all button i want to view button only guard wise - if logged person user auth then show user logout button if logged user person admin then show admin log out

how to check , i hope you understand my quarry thank you

towhid started a new conversation Multi Auth Sytem Log Out Problem

Hi , i am use here two type Auth Admin and User , i use two guards and two providers

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'admin' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
            'hash' => false,
        ],
    ],

  'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

        'admins' => [
            'driver' => 'eloquent',
            'model' => App\Admin::class,
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],


    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 60,
        ],

        'admins' => [
            'provider' => 'admins',
            'table' => 'password_resets',
            'expire' => 60,
        ],
    ],

i am using built in Auth system , and overright the Another auth guard , this is my admin login controller

    public function __construct()
    {
        $this->middleware('guest:admin')->except('logout');
    }
    /**
     * Show the application's login form.
     *
     * @return \Illuminate\Http\Response
     */
    public function showLoginForm()
    {
        return view('admin.auth.login');
    }

    protected function guard()
    {
        return Auth::guard('admin');
    }

this is my guest -redirectauthenticated middle ware

    public function handle($request, Closure $next, $guard = null)
    {
        switch ($guard) {
            case 'admin':
                if (Auth::guard($guard)->check()) {
                    return redirect('admin/home');
                }
                break;
            default:
                if (Auth::guard($guard)->check()) {
                    return redirect('/home');
                }
                break;
        }

        return $next($request);
    }

this is my handle .php file code

protected function unauthenticated($request, AuthenticationException $exception)
    {
        if ($request->expectsJson()) {
            return response()->json(['error' => 'unauthenticated.'], 401);
        }
        $guard = array_get($exception->guards(), 0);
        switch ($guard) {
            case 'admin':
                $login = 'admin.login';
                break;
            default:
                $login = 'login';
                break;
        }
        return redirect()->guest(route($login));
    }

this is my Route file

Auth::routes();

Route::get('/', function () {
    return view('welcome');
});

Route::get('/home', '[email protected]')->name('home');

Route::get('admin/home', '[email protected]');

Route::get('admin', 'Admin\[email protected]')->name('admin.login');
Route::post('admin', 'Admin\[email protected]');

Route::post('admin-password/email', 'Admin\[email protected]')->name('admin.password.email');
Route::get('admin-password/reset', 'Admin\[email protected]')->name('admin.password.request');

Route::post('admin-password/reset', 'Admin\[email protected]');
Route::get('admin-password/reset/{token}', 'Admin\[email protected]')->name('admin.password.reset');

this is y app file for layout master page

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Laravel') }}</title>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
    <div id="app">
        <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
            <div class="container">
                <a class="navbar-brand" href="{{ url('/') }}">
                    {{ config('app.name', 'Laravel') }}
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <!-- Left Side Of Navbar -->
                    <ul class="navbar-nav mr-auto">

                    </ul>

                    <!-- Right Side Of Navbar -->
                    <ul class="navbar-nav ml-auto">
                        <!-- Authentication Links -->
                        @guest
                            <li class="nav-item">
                                <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
                            </li>
                            @if (Route::has('register'))
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
                                </li>
                            @endif
                        @else
                            <li class="nav-item dropdown">
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                    {{ Auth::user()->name }} <span class="caret"></span>
                                </a>

                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href="{{ route('logout') }}"
                                       onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                        {{ __('Logout') }}
                                    </a>

                                    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                        @csrf
                                    </form>
                                </div>
                            </li>

                        @endguest
                        
                    </ul>
                </div>
            </div>
        </nav>

        <main class="py-4">
            @yield('content')
        </main>
    </div>
</body>
</html>

if i want i can login two user same browser at a time . but

now i want to logout - but i don't understand how to manage built in logout process for my all guard admin and user also

but now problem is when i click log out - its log out all user type , user and admin also ..

i want if i am user panel logout button rout to user logout method and if i am admin panel then only admin logout --

please help me expert Brother thank you

21 Jul
1 month ago

towhid left a reply on My Local Server Address After Php Artisan Serve 127.0.0.1:8000

yes you are right - its simply but i was not recognized ... thank you

towhid started a new conversation My Local Server Address After Php Artisan Serve 127.0.0.1:8000

when i hit this ip address 127.0.0.1:8000 then show / address i have not root address route controller that's why i want to redirect others link like 127.0.0.1:8000/student or 127.0.0.1:8000/login page direct how i do that ? thanks in advancea

19 Jul
1 month ago

towhid left a reply on Toastr Doesn't Work At Laravel 5.6 Or Is It Laravelmix?

try to google i hope you will get your answer 2/ 3 times try to solve from google instruction thank you

18 Jul
1 month ago

towhid started a new conversation Multi User Type In One Table , One Dashboard But Want To Show Menu User Type Login Wise How To Do That ?

i have one table name user , i use laravel auth , there are thre type user admin, assistant and user , every one login same login panel , and same dash board , but i want to show dashborad menu user type wise ? how to do that ?

which way i will go ? thanks in advance

17 Jul
2 months ago

towhid left a reply on Want To Create User Table But I Don't Understand What Can I Do Create Customize User Table Or Use Laravel Built In Auth

yes i already created but don't know where i will again hang . btw could you please tell me if i use built in and use extra field then which thing need to study - like authentication authorization - tell me all kind of section which one need to follow and study thanks for your reply - brother - @jlrd

towhid started a new conversation Want To Create User Table But I Don't Understand What Can I Do Create Customize User Table Or Use Laravel Built In Auth

if i want to create user table and use extra field then what the best for development part ? built in auth customize or create totally different table and create all kind of authentication ?

01 Jul
2 months ago

towhid left a reply on Why This Error Show In My Editor How To Solve This Error ?

<template>
  <div>
    <ul>
      <li v-for="ninja in ninjas" v-bind:key="ninja.id">{{ninja}}</li>
    </ul>
  </div>
</template>
``
<script>
export default {
  data() {
    return {
      ninjas: ["towhid", "tumpa", "tanvir", "rana", "rupam"]
    };
  }
};
</script>

i use this code - and error gone but i have no value for id - is this main reason for this error show in vscode - editor ?

towhid started a new conversation Why This Error Show In My Editor How To Solve This Error ?

<li v-for="ninja in ninjas">{{ninja}}</li>

The li element represents a list item. If its parent element is an ol, ul, or menu element, then the element is an item of the parent element's list, as defined for those elements. Otherwise, the list item has no defined list-related relationship to any other li element.

[vue/require-v-for-key] Elements in iteration expect to have 'v-bind:key' directives.eslint-plugin-vue

26 May
3 months ago

towhid left a reply on I Want To Email From My Gmail Account , My Email Work When I MAIL_DRIVER=log , But When I Try To Send Gmail Host Its Not Work

Solve the problem myself : Its Simply solution

1. enable the 2 step verification

2 . create apps password 16 character and use this .env mail password field

3. restart the server

thank you

towhid started a new conversation I Want To Email From My Gmail Account , My Email Work When I MAIL_DRIVER=log , But When I Try To Send Gmail Host Its Not Work

//log code

[2019-05-26 19:12:35] local.DEBUG: Message-ID: <[email protected]>
Date: Sun, 26 May 2019 19:12:35 +0000
Subject: contact message Querry
From: Admin management application <[email protected]>
To: towhid <[email protected]>
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

SEnd Email  

this is my env code

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=*******
MAIL_ENCRYPTION=tls

its show this error

Failed to authenticate on SMTP server with username "[email protected]" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "534", with message "534-5.7.9 Application-specific password required. Learn more at 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor j20sm2303155pfi.138 - gsmtp ". Authenticator PLAIN returned Expected response code 235 but got code "534", with message "534-5.7.9 Application-specific password required. Learn more at 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor j20sm2303155pfi.138 - gsmtp ". Authenticator XOAUTH2 returned Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials j20sm2303155pfi.138 - gsmtp 
25 May
3 months ago

towhid started a new conversation I Used Form Request For Custom Validation Rules And Message , Done With Save Method , But I Cannot Understand How To Done Update Method For This Form Request Validation File

this is my Route Code

Route::get('/create','[email protected]');
Route::post('/save','[email protected]');
Route::get('/index','[email protected]')->name('indexBox');
Route::get('/edit/{id}','[email protected]');
Route::patch('/update/{id}','[email protected]');

this is my project controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
Use App\Project;
use App\Http\Requests\ProjectCreate;
use Illuminate\Support\Facades\View;
class ProjectController extends Controller
{

    //create method
    public function create(Request $request)
    {
        return view('project.create');
    }

    //save method
    public function save(ProjectCreate $request)
    {
        $data = $request->validated();
        Project::create($data);
        return back()->with('successMessage','project created Successfully');
    }

    //index method
    public function index()
    {
        $projects = Project::all();
        if(View::exists('project.index')):
            return view('project.index',compact('projects'));
        endif;
    }

    //edit method

    public function edit($id){
        $project = Project::find($id);
        return view('project.edit')->with('project',$project);
    }

    public function update(ProjectCreate $project, $id ){
        $project->update($id->all);
        return redirect('/index')->with('successMessage','project created Successfully');
    }
}

##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',
            'description.required' => 'A description khub dorkar',
        ];
    }
}

##this is my action button

<td><a href="">View</a> | <a href="/edit/{{$project->id}}">Edit</a> | <a href="">Delete</a></td>

this is my edit blade code

<form action="/update/{{$project->id}}" method="post">
    @method('PATCH')
    @csrf
    <input type="text" name="title" placeholder="Title" class="@error('title') is-invalid @enderror" value="{{$project->title}}">
    <br><br>
    <textarea name="description" id="" cols="30" rows="3" placeholder="Description">{{$project->description}}</textarea>
    <br><br>
    <input type="submit" value="UPDATE"> 
</form>

i don't undersatnd how to make update method perfectly

thank you

24 May
3 months ago

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@CRONIX - Thanks :) this is my Real answer which one i searching :) thanks a lot Brother :) you are really good .

23 May
3 months ago

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@DEVFREY - yes but i want to redirect any others route link when 404 occurs

as a example some one try to brouse this link

www.towhid,com/blog but i have not blog route or page then time the site redirect others rout link like contact page or index page or thank you page

22 May
3 months ago

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@devfrey yes its work i just create 500 and 404 blade file create in errors folder in views folder

but i want to know what tat mean ?

The HttpException instance raised by the abort function will be passed to the view as an $exception variable:

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@DEVFREY - The HttpException instance raised by the abort function will be passed to the view as an $exception variable:

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@DEVFREY -thanks for your link but this was not solve my query with out code syntax how i call abort function

abort() ?

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@SNAPEY - i just want to redirect others page like 404 or 500 page for error exception when application data not found or page not found or server not found -

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@snapey please check my post again i update my problem details

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@SNAPEY - why mean ? for which thing ? i am confused about your reply :/

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@DEVFREY - yes i made it manualy because of, if i ave any knid of code or syntax error then its redirect another route page -- but i cannot solve this issue

i want to make my Custom error page- design

towhid left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

@SNAPEY - :/ btw - do you get my problem or i'll try again make you understand ?

towhid started a new conversation Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

i am study https://laravel.com/docs/5.8/errors

page but i didn't find out the solution when i got error for code/ syntax wrong then show this type error

compact(): Undefined variable: projescts

but i want to route with my custom blade error page .

21 May
3 months ago

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

@SERGIU17 -

or CTRL + Click on va

lidate(), you need to pass an argument to it

how to do that ?i don't understand ...

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

@CRONIX - you are r8

$data = $request->validate(); to $data = $request->validated();

this was my problem ---

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

@SERGIU17 - if i delete this line how to pass my data for database save

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

@CRONIX - its change already - but mazor problem is others .

'description.required' => 'A description khub dorkar', ];

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

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
4 months 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
4 months 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 path

towhid started a new conversation Where The Default Auth Route List Called In Laravel 5.8 [ File Name]

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
4 months ago

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

@PHPHUPPTECHNOLOGIES - after following your instruction 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