towhid

towhid

Member Since 2 Years Ago

Bangladesh

Experience Points
10,300
Total
Experience

4,700 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
17
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 3
10,300 XP
Nov
08
4 days ago
Activity icon

Replied to Laravel Intervention Image GD Library Not Support As Like Feature

@Snapey Please hep me i need this Solve Thank you

Activity icon

Replied to Help Me In Foreach Loop Scope Of Variable With Redirect To View.

user this code this file app/Providers/AppServiceProvider.php


public function boot()
{
   // add this
$referral_user_2 = ReferralUser::where('referral_id' , $first_referral->user_id)->where('status' ,1)->get();
    view()->share('referral_user_2',$referral_user_2);
}

try this one

Nov
05
1 week ago
Activity icon

Replied to Laravel Intervention Image GD Library Not Support As Like Feature

OK - understand your point ,thanks for suggestion @maverickchan

Activity icon

Replied to Laravel Intervention Image GD Library Not Support As Like Feature

hello , thanks for your Message , i don't understand what are you saying ? thanks @maverickchan

Activity icon

Replied to Laravel Intervention Image GD Library Not Support As Like Feature

hello , this reference link show me how to upload time image size resize but i want to know when show time in blade then show my selected size like -

my profile image upload size 145 height , but when show my admin panel all of user details then show time profile image size 45 , and the image size not crop or resize before just view page load my selected size that's it

if i download then file then size is 45 height and image size also less then original size ..

i don't want to save any selected size just save my store only original size , but Show time all list just 45 height and if some one download this image then show 45 height with size ration Thank you @nakov

Activity icon

Replied to Laravel Intervention Image GD Library Not Support As Like Feature

Thanks for your Reply @nakov Could you please explain the process of work GD library in laravel project or any reference where i follow - the instruction and solve my problem .

IS this right way to code structure for GD library work which one i show you ?

like think this scenario : when i declare the size of image in controller the image show in my view page those sizes . not original size which one i uploaded before the image for my profile picture -

this library need because my site load badly for long time for a page load

if i can use this library i think the loading time much less Thanks again

Nov
04
1 week ago
Activity icon

Started a new Conversation Laravel Intervention Image GD Library Not Support As Like Feature

this is my direct route in web.php file

Route::get('userimage/{img}/{h}/{w}',function($img, $h=60, $w=60){
   return \Image::make(public_path("/storage/users/images/".$img))->resize($h, $w)->response('jpg');
});

ths is my blade template

<img src="{!! url('storage/users/images', [$usergallery->image_url]) !!}"
                                         class="img-responsive" alt="">

when iam trying to resize my image load the page then its not work , not error also , if any ony who did complete this library in laravel perfectly please inform me its really help me complete my task . thank you

Oct
28
2 weeks ago
Activity icon

Replied to Mark As Read A Specific Notification In Laravel Notifications

ok after this instruction try i will inform you thank you

Activity icon

Started a new Conversation Mark As Read A Specific Notification In Laravel Notifications

when i click the who notification show and my notification box is empty , but i want to se if i click selected notification then only mark as read this notification .

but probelm is i dont underatnd how to do this ? please help m eout this problem ..

thank you

Oct
14
4 weeks ago
Activity icon

Replied to Laravel Collective Form Value Select From Database And Show Others Value Name Problem

DB data not show when i am select the Value in drop down list

Activity icon

Started a new Conversation Laravel Collective Form Value Select From Database And Show Others Value Name Problem

this is my another service provider code

        if (Schema::hasTable('registration_fields')) {
            $marital = RegistrationField::where('slug', '=', 'maritual_status')->first();
            $maritals = RegistrationFieldValue::where('registration_field_id', '=', $marital->id)->select([
                'id', 'value_name', 'value_id'
            ])->get();
            View::share('maritals', $maritals);
        }

this is my library code where i get for marital status value

    public static function getMaritalStatusList()
    {
        $slug = RegistrationField::where('slug', '=', 'maritual_status')->first();
        $marital = RegistrationFieldValue::where('registration_field_id', '=', $slug->id)->pluck('value_name', 'value_id');
        // array_add($marital, "", "Maritual Status");
        return $marital;
    }

this is my serviceprovider code

        Form::macro('selectMaritalStatus', function ($name, $selected = null, $options = []) {
            $marital = \App\Libraries\RegistrationfieldLibrary::getMaritalStatusList();
            return Form::select($name, $marital, $selected, $options);
        });

this is my controller collection

      $users = Auth::user();

this is my relation code

  public function user_info()
    {
        return $this->hasOne('App\UserInfo', 'user_id', 'id');
    }

this is my Collective form code

{!! Form::selectMaritalStatus('marital_status', [$marital->value == 2 ? 'selected' : ''], ['class'=>'form-control', 'id'=>'marital_status']) !!}

form select code

@foreach($maritals as $marital)
 @if($users->user_info->user_marital_status == $marital->value_id)
 {!! Form::select('marital_status',[$marital->value_name], ['class'=>'form-control', 'id'=>'marital_status']) !!}
@endif
@endforeach

please help me ..

Oct
07
1 month ago
Activity icon

Replied to Same Data Show In Foreach Loop How To Unique Data Show In Blade ?

No i just collect data from Database and data save as like my requirement - you just tell me - if any function laravel or any other process to show unique value ?

after googling i try this kind of function but not understand why not show output accurately.

unique(),
distinct()
pluck()
Activity icon

Started a new Conversation Same Data Show In Foreach Loop How To Unique Data Show In Blade ?

@foreach($religions as $religion)
@if($religion->value_id == $user->user_info->user_religion)
{{$religion->value_name}}
@endif
@endforeach

here is show three times show data

Here is  my data  table value 
column name 
valuename, value_id 
muslim => 1, 
buddhist => 2, 
hindu ] => 3;
muslim = > 1,
hindu => 3,

checking value_id show value name     , 

i need answer only muslim  when value id match 1 
Activity icon

Replied to Big Project LARAVEL MIX Problem

BTW this is unsolved problem , i just avoid this issue . thanks all

Sep
09
2 months ago
Activity icon

Replied to Big Project LARAVEL MIX Problem

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

Sep
07
2 months ago
Activity icon

Replied to 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

Sep
04
2 months ago
Activity icon

Replied to 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 -

Sep
02
2 months ago
Activity icon

Replied to 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

Sep
01
2 months ago
Activity icon

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

Aug
27
2 months ago
Activity icon

Replied to 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

Aug
11
3 months ago
Activity icon

Replied to Custom Create Route For A Specific Resource

just over right the code= the route code

Activity icon

Replied to 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 ?

Aug
10
3 months ago
Activity icon

Replied to 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

Activity icon

Replied to 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

Aug
09
3 months ago
Activity icon

Replied to 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 ?

Activity icon

Replied to 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

Activity icon

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

Jul
21
3 months ago
Activity icon

Replied to 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

Activity icon

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

Jul
19
3 months ago
Activity icon

Replied to 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

Jul
18
3 months ago
Activity icon

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

Jul
17
3 months ago
Activity icon

Replied to 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

Activity icon

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 ?

Jul
01
4 months ago
Activity icon

Replied to 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 ?

Activity icon

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

May
26
5 months ago
Activity icon

Replied to 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

Activity icon

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 
May
25
5 months ago
Activity icon

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

May
24
5 months ago
Activity icon

Replied to 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 .

May
23
5 months ago
Activity icon

Replied to 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

May
22
5 months ago
Activity icon

Replied to 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:

Activity icon

Replied to 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:

Activity icon

Replied to 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() ?
Activity icon

Replied to 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 -

Activity icon

Replied to Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

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