jsanwo64

jsanwo64

Member Since 3 Years Ago

Lagos

Experience Points
1,210
Total
Experience

3,790 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
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 1
1,210 XP
Feb
05
2 weeks ago
Activity icon

Started a new Conversation SQLSTATE[HY000]: General Error: 1364 Field 'id' Doesn't Have A Default Value

on localhost i can signup and login without any issue but on the live server i keep getting this error.

my User.php

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'fullname', 'username', 'email', 'role_selection', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}


my migration

Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('fullname')->nullable();
            $table->string('username')->nullable();
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->string('role_selection');    
            $table->rememberToken();
            $table->timestamps();
        });
Jan
11
1 month ago
Activity icon

Replied to Where Are You All From?

Nigeria

Activity icon

Replied to Submitting A Form To Multiple URLs

Can you help with the JS option or how I can go about it?

Activity icon

Replied to Laravel 6.9 Localhost Keep Loading Than Not Found

Did you run key:generate?

Activity icon

Started a new Conversation Submitting A Form To Multiple URLs

I'm currently trying to integrate Salesforce on my website and I need to get the user details submitted to Salesforce when they register and at the same time I need to have those details submitted to the database of my application. Is having multiple actions in the form tag possible?

<!DOCTYPE html>
<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Test</title>
    </head>

<body>
    <h1>Search for a Domain or IP</h1>
        <form method="get" action="https://www.virustotal.com/en/domain/%s/information/","https://duckduckgo.com/search.html?prefill=Search DuckDuckGo" target="_blank" onsubmit="submitSearch()">
        <input type="text" placeholder="Search..." required>
        <input type="button" value="Search">
    </form>
</body>
</html>
Activity icon

Replied to Laravel 6.9 Localhost Keep Loading Than Not Found

Try to restart your apache server and type php artisan serve again

Dec
29
1 month ago
Activity icon

Started a new Conversation CAPTHCA With Laravel

i keep getting error with the following


// Checks if form has been submitted
@if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    function post_captcha($user_response) {
        $fields_string = '';
        $fields = array(
            'secret' => '',
            'response' => $user_response
        );
        foreach($fields as $key=>$value)
        $fields_string .= $key . '=' . $value . '&';
        $fields_string = rtrim($fields_string, '&');

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify');
        curl_setopt($ch, CURLOPT_POST, count($fields));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, True);

        $result = curl_exec($ch);
        curl_close($ch);

        return json_decode($result, true);
    }

    // Call the function post_captcha
    $res = post_captcha($_POST['g-recaptcha-response']);

    @if (!$res['success']) {
        // What happens when the CAPTCHA wasn't checked
        echo '<p>Please go back and make sure you check the security CAPTCHA box.</p><br>';
    } else {
        // If CAPTCHA is successfully completed...

        // Paste mail function or whatever else you want to happen here!
        echo '<br><p>CAPTCHA was completed successfully!</p><br>';
    }
} else { 
                        <!-- Default Form -->
                        <div class="default-form contact-form">
                            <form method="post" action="{{ url('/contact') }}" id="contact-form" role="form">
                                @csrf
                                <div class="form-group{{ $errors->has('fullname') ? ' has-error' : '' }}">
                                    <input type="text" name="fullname" value="{{ old('fullname') }}" placeholder="Name*" required class="form-control">
                                     @if ($errors->has('fullname'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('fullname') }}</strong>
                                    </span>
                                @endif
                                </div>
                                
                                <div class="form-group{{ $errors->has('phone_number') ? ' has-error' : '' }}">
                                    <input type="number" name="phone_number" value="{{ old('phone_number') }}" placeholder="Phone Number*" required class="form-control">
                                     @if ($errors->has('phone_number'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('phone_number') }}</strong>
                                    </span>
                                @endif
                                </div>
                                
                                <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                                    <input type="email" name="email" value="{{ old('email') }}" placeholder="Email*" required class="form-control">
                                     @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                    </span>
                                @endif
                                </div>
                                
                                <div class="form-group{{ $errors->has('message') ? ' has-error' : '' }}">
                                    <textarea name="message" placeholder="Your Message" class="form-control"></textarea>
                                     @if ($errors->has('message'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('message') }}</strong>
                                    </span>
                                @endif
                                </div>
                                
                                <div class="form-group">
                                    <button type="submit" class="theme-btn btn-style-one"><span class="txt">Submit now</span></button>
                                </div> 
                                
                                <div class="g-recaptcha" data-sitekey=""></div>
                                
                            </form> 
                            
                            }@endif

Nov
17
3 months ago
Activity icon

Replied to Migrating Rinvex Tables Return This Error


Server: 127.0.0.1 via TCP/IP
Server type: MariaDB
Server version: 10.1.31-MariaDB - mariadb.org binary distribution
Protocol version: 10
User: [email protected]
Server charset: UTF-8 Unicode (utf8)
Activity icon

Started a new Conversation Migrating Rinvex Tables Return This Error

*******************************************
*     Migrate Rinvex Bookings Tables.     *
*******************************************

Migrating: 2019_11_17_154305_create_bookable_bookings_table

   Illuminate\Database\QueryException  : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null, `notes` text null, `created_at` timestamp null, `updated_at` timestam' at line 1 (SQL: create table `bookable_bookings` (`id` int unsigned not null auto_increment primary key, `bookable_type` varchar(191) not null, `bookable_id` bigint unsigned not null, `customer_type` varchar(191) not null, `customer_id` bigint unsigned not null, `starts_at` datetime null, `ends_at` datetime null, `canceled_at` datetime null, `timezone` varchar(191) null, `price` decimal(8, 2) not null default '0.00', `quantity` int unsigned not null, `total_paid` decimal(8, 2) not null default '0.00', `currency` varchar(3) not null, `formula` text null, `options` json null, `notes` text null, `created_at` timestamp null, `updated_at` timestamp null, `deleted_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

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

  Exception trace:

  1   PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null, `notes` text null, `created_at` timestamp null, `updated_at` timestam' at line 1")
      C:\xampp\htdocs\sample\vendor\laravel\framework\src\Illuminate\Database\Connection.php:453

  2   PDO::prepare("create table `bookable_bookings` (`id` int unsigned not null auto_increment primary key, `bookable_type` varchar(191) not null, `bookable_id` bigint unsigned not null, `customer_type` varchar(191) not null, `customer_id` bigint unsigned not null, `starts_at` datetime null, `ends_at` datetime null, `canceled_at` datetime null, `timezone` varchar(191) null, `price` decimal(8, 2) not null default '0.00', `quantity` int unsigned not null, `total_paid` decimal(8, 2) not null default '0.00', `currency` varchar(3) not null, `formula` text null, `options` json null, `notes` text null, `created_at` timestamp null, `updated_at` timestamp null, `deleted_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'")
      C:\xampp\htdocs\sample\vendor\laravel\framework\src\Illuminate\Database\Connection.php:453

  Please use the argument -v to see more details.
Oct
13
4 months ago
Activity icon

Replied to Spatie / Cookie-consent Can Not Find The Language File

Can you please help with the other packages you used

Oct
01
4 months ago
Activity icon

Started a new Conversation Pdf Upload To Database And Storage Filesystem

i currently have this code but i keep getting "General error: 1364 Field 'cv' doesn't have a default value"

below is my controller.

public function post_cv(Request $request){
        $validator = Validator::make($request->all(), [
             'fullname' => 'required',
             'phone_number' => 'required',
             'email' => 'required',
             'cv' => 'required',
             'cl' => 'required',
             ]);

       if ($validator->fails()) {
           return redirect('/careers')
                    ->withErrors($validator)
                    ->withInput(); 
       }else {

        $cv = new Cv;

       $cv->full_name = $request->input('fullname');
       $cv->email = $request->input('phone_number');
       $cv->phone_number    = $request->input('email');
       $cv->letter      = $request->input('cl');

          if(!empty($file)):
            $file = $request->file('cv');
           Storage::put($file->getClientOriginalName(), file_get_contents($file));
             $cv->cv = $file;
    endif;

       $cv->save();
   return back()->with('message', 'Cv uploaded successfully!!!');
       }

    }
Sep
27
4 months ago
Activity icon

Replied to Middleware Error

Thanks it worked, I just got to know of the policies for authorization will be making use of it more often. 👍

Sep
26
4 months ago
Activity icon

Replied to Middleware Error

I believe the error is coming from my staff Middleware

Activity icon

Started a new Conversation Middleware Error

i have three middlewares namely Admin middleware, Staff middleware and Client middleware,

the admin middleware works fine same with the Staff middleware the only problem im having is that my client can access the staff profile page which not mean to be so.

My client middleware

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class ClientMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  string|null  $guard
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check() && Auth::user()->role_selection === 'Client') {
            return $next($request);
        }else{

            return redirect('/login');
        }

    
    }
}

my Staff middleware

<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class StaffMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  string|null  $guard
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check() && Auth::user()->role_selection === 'Registered-Nurse' || 'Healthcare-Assistant' || 'Support-Worker' || 'Domestic-Staff') {
            return $next($request);
        }else{

            return redirect('/login');
        }

    
    }
}

this is the routes

Route::get('/user/profile', '[email protected]')->name('user.profile')->middleware('isStaff');
Route::get('/client/profile', '[email protected]')->name('client.profile')->middleware('isClient');
Sep
23
5 months ago
Activity icon

Replied to FatalThrowableError In StaffController.php Line 83: Class 'Image' Not Found

Image Intervention does not work on laravel 5.2 but it works well on 5.3 , i just migrated to 6 and it works smoothly

Activity icon

Replied to FatalThrowableError In StaffController.php Line 83: Class 'Image' Not Found

@itsfg here is my app.php

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Application Environment
    |--------------------------------------------------------------------------
    |
    | This value determines the "environment" your application is currently
    | running in. This may determine how you prefer to configure various
    | services your application utilizes. Set this in your ".env" file.
    |
    */

    'env' => env('APP_ENV', 'production'),

    /*
    |--------------------------------------------------------------------------
    | Application Debug Mode
    |--------------------------------------------------------------------------
    |
    | When your application is in debug mode, detailed error messages with
    | stack traces will be shown on every error that occurs within your
    | application. If disabled, a simple generic error page is shown.
    |
    */

    'debug' => env('APP_DEBUG', false),

    /*
    |--------------------------------------------------------------------------
    | Application URL
    |--------------------------------------------------------------------------
    |
    | This URL is used by the console to properly generate URLs when using
    | the Artisan command line tool. You should set this to the root of
    | your application so that it is used when running Artisan tasks.
    |
    */

    'url' => env('APP_URL', 'http://localhost'),

    /*
    |--------------------------------------------------------------------------
    | Application Timezone
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default timezone for your application, which
    | will be used by the PHP date and date-time functions. We have gone
    | ahead and set this to a sensible default for you out of the box.
    |
    */

    'timezone' => 'UTC',

    /*
    |--------------------------------------------------------------------------
    | Application Locale Configuration
    |--------------------------------------------------------------------------
    |
    | The application locale determines the default locale that will be used
    | by the translation service provider. You are free to set this value
    | to any of the locales which will be supported by the application.
    |
    */

    'locale' => 'en',

    /*
    |--------------------------------------------------------------------------
    | Application Fallback Locale
    |--------------------------------------------------------------------------
    |
    | The fallback locale determines the locale to use when the current one
    | is not available. You may change the value to correspond to any of
    | the language folders that are provided through your application.
    |
    */

    'fallback_locale' => 'en',

    /*
    |--------------------------------------------------------------------------
    | Encryption Key
    |--------------------------------------------------------------------------
    |
    | This key is used by the Illuminate encrypter service and should be set
    | to a random, 32 character string, otherwise these encrypted strings
    | will not be safe. Please do this before deploying an application!
    |
    */

    'key' => env('APP_KEY'),

    'cipher' => 'AES-256-CBC',

    /*
    |--------------------------------------------------------------------------
    | Logging Configuration
    |--------------------------------------------------------------------------
    |
    | Here you may configure the log settings for your application. Out of
    | the box, Laravel uses the Monolog PHP logging library. This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Settings: "single", "daily", "syslog", "errorlog"
    |
    */

    'log' => env('APP_LOG', 'single'),

    'log_level' => env('APP_LOG_LEVEL', 'debug'),

    /*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    | The service providers listed here will be automatically loaded on the
    | request to your application. Feel free to add your own services to
    | this array to grant expanded functionality to your applications.
    |
    */

    'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,
        Intervention\Image\ImageServiceProvider::class,


        /*
         * Package Service Providers...
         */


        /*
         * Application Service Providers...
         */
        App\Providers\AppServiceProvider::class,
        App\Providers\AuthServiceProvider::class,
        App\Providers\EventServiceProvider::class,
        App\Providers\RouteServiceProvider::class,

    ],

    /*
    |--------------------------------------------------------------------------
    | Class Aliases
    |--------------------------------------------------------------------------
    |
    | This array of class aliases will be registered when this application
    | is started. However, feel free to register as many as you wish as
    | the aliases are "lazy" loaded so they don't hinder performance.
    |
    */

    'aliases' => [

        'App' => Illuminate\Support\Facades\App::class,
        'Artisan' => Illuminate\Support\Facades\Artisan::class,
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'Blade' => Illuminate\Support\Facades\Blade::class,
        'Cache' => Illuminate\Support\Facades\Cache::class,
        'Config' => Illuminate\Support\Facades\Config::class,
        'Cookie' => Illuminate\Support\Facades\Cookie::class,
        'Crypt' => Illuminate\Support\Facades\Crypt::class,
        'DB' => Illuminate\Support\Facades\DB::class,
        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
        'Event' => Illuminate\Support\Facades\Event::class,
        'File' => Illuminate\Support\Facades\File::class,
        'Gate' => Illuminate\Support\Facades\Gate::class,
        'Hash' => Illuminate\Support\Facades\Hash::class,
        'Image' => Intervention\Image\Facades\Image::class,
        'Lang' => Illuminate\Support\Facades\Lang::class,
        'Log' => Illuminate\Support\Facades\Log::class,
        'Mail' => Illuminate\Support\Facades\Mail::class,
        'Password' => Illuminate\Support\Facades\Password::class,
        'Queue' => Illuminate\Support\Facades\Queue::class,
        'Redirect' => Illuminate\Support\Facades\Redirect::class,
        'Redis' => Illuminate\Support\Facades\Redis::class,
        'Request' => Illuminate\Support\Facades\Request::class,
        'Response' => Illuminate\Support\Facades\Response::class,
        'Route' => Illuminate\Support\Facades\Route::class,
        'Schema' => Illuminate\Support\Facades\Schema::class,
        'Session' => Illuminate\Support\Facades\Session::class,
        'Storage' => Illuminate\Support\Facades\Storage::class,
        'URL' => Illuminate\Support\Facades\URL::class,
        'Validator' => Illuminate\Support\Facades\Validator::class,
        'View' => Illuminate\Support\Facades\View::class,

    ],

];


Activity icon

Started a new Conversation FatalThrowableError In StaffController.php Line 83: Class 'Image' Not Found

here is my controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;


use Image;


use Auth;


use App\User;

use Validator;
use Redirect;

use Illuminate\Support\Facades\Hash;

use App\Http\Requests;

class StaffController extends Controller
{


    public function profile()
    {
        return view('user-profile');
    }
     
     public function applications()
    {
        return view('user-applications');
    }



    public function update_account(Request $request){
        $validator = Validator::make($request->all(), [
             'first_name' => 'required',
             'last_name' => 'required',
             'gender' => 'required',
             'dob' => 'required',
             'username' => 'required',
             'address1' => 'required',
             'state' => 'required',
             'address2' => 'required',
             'postcode' => 'required',
             'email' => 'required',
             'city' => 'required',
             'country' => 'required',
             'avatar' => 'required',
             'password' => 'required',
             ]);

       if ($validator->fails()) {
           return redirect('/user/account-settings')
                    ->withErrors($validator)
                    ->withInput(); 
       }else {

        $id = Auth::user()->id;

       $update_staff_profile             = User::find($id);
       $update_staff_profile->first_name = $request->input('first_name');
       $update_staff_profile->last_name = $request->input('last_name');
       $update_staff_profile->gender    = $request->input('gender');
       $update_staff_profile->dob       = $request->input('dob');
       $update_staff_profile->username  = $request->input('username');
       $update_staff_profile->address1  = $request->input('address1');
       $update_staff_profile->state     = $request->input('state');
       $update_staff_profile->address2  = $request->input('address2');
       $update_staff_profile->postcode  = $request->input('postcode');
       $update_staff_profile->email      = $request->input('email');
       $update_staff_profile->city      = $request->input('city');
       $update_staff_profile->country   = $request->input('country');
       $update_staff_profile->password  = Hash::make($request->input('password'));

       if($request->hasFile('avatar')){
           $image = $request->file('avatar');
           $filename = time() . '.' . $image->getClientOriginalExtension();
           Image::make($image)->resize(350, 232)->save( public_path('/uploads/staffs/avatar' . $filename));
             $update_staff_profile->avatar = $filename;

     }

       dd($update_staff_profile);
       $update_staff_profile->save();
   return back()->with('message', 'Profile updated successfully!!!');
       }

    }



}


Sep
18
5 months ago
Activity icon

Replied to How Many Middleware Am I Allowed To Include In The Get Method Of The Routes.

i am getting this error

 [Symfony\Component\Debug\Exception\FatalThrowableError]
  Type error: Argument 2 passed to Illuminate\Routing\Controller::middleware() must be of the type array, string given, called in C:\xampp\htdocs\laravel-practice\ap
  p\Http\Controllers\StaffController.php on line 14
Activity icon

Replied to How Many Middleware Am I Allowed To Include In The Get Method Of The Routes.

is this also correct

  public function __construct()
    {
        $this->middleware('isRn' 'isSw');
    }
Activity icon

Started a new Conversation How Many Middleware Am I Allowed To Include In The Get Method Of The Routes.


Route::get('/user/profile', '[email protected]')->name('user.profile')->middleware('isRn','isSw');

Route::get('/user/applications', '[email protected]')->name('user.applications')->middleware('isSw','isRn');
Sep
11
5 months ago
Activity icon

Replied to What Am I Doing Wrong

@punksolid I Have menu which is a drop down with the following items, home care, specialist care and support living, now if I am on any of those page I need the menu holding them item to have a class named current eg class="current"

Activity icon

Started a new Conversation What Am I Doing Wrong

   @if(Request::path() == 'support-living')  
       <li class="current"><a href="#">Care Services</a>
                                        <ul>
                                            <li><a href="respite-care.html">Home Care</a></li>
                                            <li><a href="personal-care.html">Specialist Care</a></li>
                                            <li><a href="elderly-service.html">Supported Living</a></li>
                                        </ul>
                                    </li>     
                                    @elseif(Request::path() == 'home-care')  
 <li class="current"><a href="#">Care Services</a>
                                        <ul>
                                            <li><a href="respite-care.html">Home Care</a></li>
                                            <li><a href="personal-care.html">Specialist Care</a></li>
                                            <li><a href="elderly-service.html">Supported Living</a></li>
                                        </ul>
                                    </li>      
@elseif(Request::path() == 'specialist-care')  
 <li class="current"><a href="#">Care Services</a>
                                        <ul>
                                            <li><a href="respite-care.html">Home Care</a></li>
                                            <li><a href="personal-care.html">Specialist Care</a></li>
                                            <li><a href="elderly-service.html">Supported Living</a></li>
                                        </ul>
                                    </li>  
@endif