finchy70

Head of Systems at EPS

Member Since 3 Years Ago

Swansea

Experience Points
21,030
Total
Experience

3,970 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
147
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 5
21,030 XP
Feb
17
1 week ago
Activity icon

Replied to Tailwind Styles Broken In Production

That works. Thank you.

Feb
16
1 week ago
Activity icon

Replied to Tailwind Styles Broken In Production

A regex pattern that would catch col-start-3 and col-span-2 would be

col-[a-z]*-\d

but inserting this as the pattern also doesn't work.

Activity icon

Replied to Tailwind Styles Broken In Production

No this didn't work either. Would love to know how to safelist / whitelist for future reference.

Feb
15
2 weeks ago
Activity icon

Replied to Tailwind Styles Broken In Production

Did a dirty workaround by inserting

@if(! true)
                <div class="col-start-1 col-start-2 col-start-3 col-start-4 col-start-5 col-start-6 col-start-7 col-span-1 col-span-2 col-span-3 col-span-4 col-span-5 col-span-6 col-span-7"></div>
            @endif

before

<ul class="col-start-{{$start}} col-span-{{$end-($start-1)}} bg-white rounded-lg shadow">

Would still like to know how to properly use safelist with Laravel.

Activity icon

Replied to Tailwind Styles Broken In Production

I'm on tailwindcss v 2.0.3

Also tried

const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
    purge: {
        content: ['./resources/views/**/*.blade.php'],
        options: {
            safelist: {
                greedy: ['/col-/']
            },
        }
    },
    theme: {
        extend: {
            fontFamily: {
                sans: ['Inter var', ...defaultTheme.fontFamily.sans],
            },
        },
    },
  variants: {},
  plugins: [
      require('@tailwindcss/ui'),
  ],
}

This gave this error.

/var/www/html/node_modules/tailwindcss/node_modules/purgecss/lib/purgecss.js:1
(function (exports, require, module, __filename, __dirname) { "use ..........
Activity icon

Replied to Tailwind Styles Broken In Production

Tried this

const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
    purge: ['./resources/views/**/*.blade.php'],
    safelist: { greedy: ['/col-start-$/', '/col-span-$/']},
    theme: {
        extend: {
            fontFamily: {
                sans: ['Inter var', ...defaultTheme.fontFamily.sans],
            },
        },
    },
  variants: {},
  plugins: [
      require('@tailwindcss/ui'),
  ],
}

doesn't work.

Activity icon

Replied to Tailwind Styles Broken In Production

Thank you. I now know why it doesn't work. How do I whitelist all grid classes?

Activity icon

Started a new Conversation Tailwind Styles Broken In Production

I have a Job Diary app which shows jobs across the days of the week. In development the app works fine. In development

In production all jobs show in first column. In production

The problem bit of code seems to be this.

<ul class="col-start-{{$start}} col-span-{{$end-($start-1)}} bg-white rounded-lg shadow">

It seems after purgecss runs the styles break. If I upload the full 3MB+ css file to the production server all works fine.

My tailwind.config.js looks like this

const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
    purge: ['./resources/views/**/*.blade.php'],
    theme: {
        extend: {
            fontFamily: {
                sans: ['Inter var', ...defaultTheme.fontFamily.sans],
            },
        },
    },
  variants: {},
  plugins: [
      require('@tailwindcss/ui'),
  ],
}

My tailwind entries in my package.json look like this

"devDependencies": {
        "axios": "^0.19",
        "browser-sync": "^2.26.12",
        "browser-sync-webpack-plugin": "^2.0.1",
        "cross-env": "^7.0",
        "laravel-mix": "^5.0.1",
        "laravel-mix-purgecss": "^5.0.0",
        "lodash": "^4.17.19",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.15.2",
        "sass-loader": "^8.0.0",
        "vue-template-compiler": "^2.6.11"
    },
    "dependencies": {
        "@tailwindcss/ui": "^0.5.0",
        "autoprefixer": "^10.2.4",
        "postcss": "^8.2.6",
        "tailwindcss": "^2.0.3"
    }

Any ideas what Im doing wrong?

Feb
05
3 weeks ago
Activity icon

Replied to Change Password Reset Email In Laravel Breeze

Exactly what I was looking for. Thanks.

Activity icon

Replied to Change Password Reset Email In Laravel Breeze

Hi, That allows me to change the content of the Email (Text and Button) but I cant change the Laravel Logo.

Activity icon

Started a new Conversation Change Password Reset Email In Laravel Breeze

How do I change the email sent for password reset by Laravel Breeze?

Activity icon

Awarded Best Reply on Adding Files To A Zip Archive

This worked in the end. I was getting the zip paths and the file paths mixed up.

public function get_all_valid_certs_by_engineer(Engineer $engineer)
    {
        $zip_dir = storage_path().'/app/';
        $public_dir = public_path();
        $file_name = "certs.zip";
        $zip = new ZipArchive;
        $qualifications = Qualification::where('engineer_id', $engineer->id)->get();
        if ($zip->open($public_dir.'/'.$file_name, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE)
        {
            foreach($qualifications as $qualification)
            {
                $certs = $qualification->training_certs()->where('expiry', '>', now())->get();
                if ($certs->count() > 0)
                {
                    foreach ($certs as $cert)
                    {
                        $zip->addFile($zip_dir.$cert->url, $cert->filename);
                    }
                }
            }
            $zip->close();
        }
        return response()->download($public_dir.'/'.$file_name);
    }
Feb
03
3 weeks ago
Activity icon

Replied to Adding Files To A Zip Archive

This worked in the end. I was getting the zip paths and the file paths mixed up.

public function get_all_valid_certs_by_engineer(Engineer $engineer)
    {
        $zip_dir = storage_path().'/app/';
        $public_dir = public_path();
        $file_name = "certs.zip";
        $zip = new ZipArchive;
        $qualifications = Qualification::where('engineer_id', $engineer->id)->get();
        if ($zip->open($public_dir.'/'.$file_name, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE)
        {
            foreach($qualifications as $qualification)
            {
                $certs = $qualification->training_certs()->where('expiry', '>', now())->get();
                if ($certs->count() > 0)
                {
                    foreach ($certs as $cert)
                    {
                        $zip->addFile($zip_dir.$cert->url, $cert->filename);
                    }
                }
            }
            $zip->close();
        }
        return response()->download($public_dir.'/'.$file_name);
    }
Activity icon

Started a new Conversation Adding Files To A Zip Archive

I have a couple of nested queries that pull valid certs from the database by engineer.

I am trying to get a "Get all valid certs button' to create a zip containing all the valid certs (in date expiry > now() ) for a specific engineer. Certs are stored in /storage /app/certs and the database entries are 'qualification_id, filename, and url'.

I get the certs with a couple of nested loops but cant figure out how to create the zip.

Here is the controller.

public function get_all_valid_certs_by_engineer(Engineer $engineer)
    {
        $file_name = "certs.zip";
        $zip = new ZipArchive;
        $zip->open($file_name, ZipArchive::CREATE);
        $qualifications = Qualification::where('engineer_id', $engineer->id)->get();
        foreach($qualifications as $qualification)
        {
            $certs = $qualification->training_certs()->where('expiry', '>', now())->get();
            if ($certs->count() > 0)
            {
                foreach ($certs as $cert)
                {
                    $zip->addFile('storage/app/'.$cert->url);
                }
            }
        }
        $zip->close();
        return response()->download($file_name);
    }

This gives me the error

The file "certs.zip" does not exist

Any ideas?

Feb
02
3 weeks ago
Activity icon

Started a new Conversation Problems With Wire:change And @change On Page Page

I have a page that shows a date picker dynamically dependant on a select box selection. I use wire:change to listen for a change in the selectbox selection and @change (alpine.js) in order to get Pikaday to work as per Livewire screencast tutorial.

@section('styles')
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/pikaday/css/pikaday.css">
@endsection

<div class="max-w-2xl mx-auto">
    <div>
        <form wire:submit.prevent="addTool()">
            <label for="tool_name" class="mt-4 block text-md font-medium text-gray-700">Tool</label>
            <div class="mt-1">
                <input type="text" wire:model.lazy="tool_name" name="tool_name" id="tool_name" class="px-4 py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md" value="">
            </div>
            @error('tool_name')<span class="text-red-500 text-xs italic">{{$message}}</span> @enderror

            <label for="tool_description" class="mt-4 block text-md font-medium text-gray-700">Description</label>
            <div class="mt-1">
                <input type="text" wire:model.lazy="tool_description" name="tool_description" id="tool_description" class="px-4 py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md" value="">
            </div>
            @error('tool_description')<span class="text-red-500 text-xs italic">{{$message}}</span> @enderror

            <label for="tool_serial" class="mt-4 block text-md font-medium text-gray-700">Serial</label>
            <div class="mt-1">
                <input type="text" wire:model.lazy="tool_serial" mane="tool_serial" id="tool_serial" class="px-4 py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md" value="">
            </div>
            @error('tool_serial')<span class="text-red-500 text-xs italic">{{$message}}</span> @enderror

            <hr class="mt-4 border-indigo-600">

            <label for="selected_category" class="mt-4 block text-md font-medium text-gray-700">Category</label>
            <select wire:model.lazy="selected_category" class="mt-1 px-4 py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md" wire:change="checkIfExpires" >
                <option disabled selected value="null">Please select one</option>
                @foreach($tool_categories as $category)
                    <option value="{{$category->id}}">{{ $category->category_name }}</option>
                @endforeach
            </select>

            @if($show)
                <div x-data
                     x-init="new Pikaday({ field: $refs.dateInput, format:('DD-MM-YYYY') })"
                     @change="$dispatch('dateInput', $event.target.value)"
                >

                    <label for="expiry_date" class="mt-4 block text-md font-medium text-gray-700">Needs Inspection / Calibration On</label>
                    <div class="mt-1">
                        <input x-ref="dateInput" type="text" wire:model="expiry_date" autocomplete="off" name="expiry_date" class="px-4 py-2 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md">
                    </div>
                </div>
                @error('expiry_date')<span class="text-red-500 text-xs italic">{{$message}}</span> @enderror
            @endif

            <div class="row flex justify-end">
                <a href="{{route('health_and_safety.tools')}}" class="mt-6 mr-4 py-2 px-4 border border-transparent rounded-md shadow-sm text-xs font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Back</a>
                <button type="submit" class="mt-6 py-2 px-4 border border-transparent rounded-md shadow-sm text-xs font-medium text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">Save</button>
            </div>
        </form>
    </div>
</div>

@section('scripts')
    <script src="https://unpkg.com/moment"></script>
    <script src="https://cdn.jsdelivr.net/npm/pikaday/pikaday.js"></script>
@endsection

When I change the selectbox I get this console error.

morphAttrs.js:37 Uncaught (in promise) DOMException: Failed to execute 'setAttribute' on 'Element': '@change' is not a valid attribute name.
    at morphAttrs (http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:79354)
    at morphEl (http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:85358)
    at http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:86814
    at morphEl (http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:88635)
    at http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:86814
    at morphEl (http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:88635)
    at http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:86814
    at morphEl (http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:88635)
    at http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:89696
    at Component.value (http://localhost:3000/livewire/livewire.js?id=936e5d0fb0b76b631ba7:13:117615)

If I remove the @change the showing of the date picker dynamically works but I can't save any selected date.

Any ideas?

Activity icon

Awarded Best Reply on Can't Deploy To Forge. Composer Errors.

I finally fixed this by using the console in the digital ocean droplet and going to home/forge/the-site-in-question and running composer self-update there.

Jan
28
1 month ago
Activity icon

Replied to Can't Deploy To Forge. Composer Errors.

I finally fixed this by using the console in the digital ocean droplet and going to home/forge/the-site-in-question and running composer self-update there.

Activity icon

Replied to Can't Deploy To Forge. Composer Errors.

Tried composer self-update on forge via ssh and I get the following errors.

Deprecation Notice: Required parameter $path follows optional parameter $schema in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:108
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130
Updating to version 2.0.9 (stable channel).
   Downloading (100%)         
Deprecation Notice: Function openssl_free_key() is deprecated in phar:///usr/local/bin/composer/src/Composer/Command/SelfUpdateCommand.php:230

                                                                               
  [ErrorException]                                                             
  rename(/home/forge/.cache/composer/composer-temp.phar,/usr/local/bin/compos  
  er): Permission denied                                                       
                                                                               

Also ran composer -V and it's currently at 1.10.1

Jan
22
1 month ago
Activity icon

Replied to Can't Deploy To Forge. Composer Errors.

In development my macOs and sail php versions are 8.

 paul  ~/code/inspect_server   Test-php8  php -v
PHP 8.0.1 (cli) (built: Jan  8 2021 12:43:54) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies
 paul  ~/code/inspect_server   Test-php8  sail php -v
PHP 8.0.1 (cli) (built: Jan 13 2021 08:22:35) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.1, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.1, Copyright (c), by Zend Technologies

And in production my site on forge is php8. I can run composer update or sail composer update with no errors but Deploying to forge gives the errors above in original post. These errors seem to refer to files on the host. Not sure how I would go about fixing those.

Jan
21
1 month ago
Activity icon

Started a new Conversation Can't Deploy To Forge. Composer Errors.

In development I have a Laravel 8.24 / PHP 8.0.1 app that works fine and when I composer update it updates fine.

When I deploy to forge from the github repo the deployment fails and errors that seem to relate to composer are in the log.

Thu Jan 21 23:25:24 UTC 2021
From github.com:finchy70/inspect_server
 * branch            main       -> FETCH_HEAD
   c47f784..32ab536  main       -> origin/main
Updating c47f784..32ab536
Fast-forward
 .idea/workspace.xml              |  12 +-
 app/Http/Middleware/Approved.php |   3 +-
 composer.lock                    | 663 ++++++++++++++++++++-------------------
 3 files changed, 343 insertions(+), 335 deletions(-)
Deprecation Notice: Required parameter $path follows optional parameter $schema in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:62
Deprecation Notice: Required parameter $path follows optional parameter $schema in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:108
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130
Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
PHP Fatal error:  Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/DefaultPolicy.php:84
Stack trace:
#0 [internal function]: array_merge()
#1 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array()
#2 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php(387): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages()
#3 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php(740): Composer\DependencyResolver\Solver->selectAndInstall()
#4 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php(231): Composer\DependencyResolver\Solver->runSat()
#5 phar:///usr/local/bin/composer/src/Composer/Installer.php(489): Composer\DependencyResolver\Solver->solve()
#6 phar:///usr/local/bin/composer/src/Composer/Installer.php(232): Composer\Installer->doInstall()
#7 phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php(122): Composer\Installer->run()
#8 phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php(245): Composer\Command\InstallCommand->execute()
#9 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run()
#10 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand()
#11 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(281): Symfony\Component\Console\Application->doRun()
#12 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun()
#13 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(113): Symfony\Component\Console\Application->run()
#14 phar:///usr/local/bin/composer/bin/composer(61): Composer\Console\Application->run()
#15 /usr/local/bin/composer(24): require('...')
#16 {main}
  thrown in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/DefaultPolicy.php on line 84

Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/DefaultPolicy.php:84
Stack trace:
#0 [internal function]: array_merge()
#1 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/DefaultPolicy.php(84): call_user_func_array()
#2 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php(387): Composer\DependencyResolver\DefaultPolicy->selectPreferredPackages()
#3 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php(740): Composer\DependencyResolver\Solver->selectAndInstall()
#4 phar:///usr/local/bin/composer/src/Composer/DependencyResolver/Solver.php(231): Composer\DependencyResolver\Solver->runSat()
#5 phar:///usr/local/bin/composer/src/Composer/Installer.php(489): Composer\DependencyResolver\Solver->solve()
#6 phar:///usr/local/bin/composer/src/Composer/Installer.php(232): Composer\Installer->doInstall()
#7 phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php(122): Composer\Installer->run()
#8 phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php(245): Composer\Command\InstallCommand->execute()
#9 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run()
#10 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand()
#11 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(281): Symfony\Component\Console\Application->doRun()
#12 phar:///usr/local/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun()
#13 phar:///usr/local/bin/composer/src/Composer/Console/Application.php(113): Symfony\Component\Console\Application->run()
#14 phar:///usr/local/bin/composer/bin/composer(61): Composer\Console\Application->run()
#15 /usr/local/bin/composer(24): require('...')
#16 {main}
  thrown in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/DefaultPolicy.php on line 84

I have ssh into forge and tried to composer update directly in the apps directory but get same errors.

Forge site is set as PHP 8 and the installed php8 cli and php8 versions are default.

Please help.

Nov
19
3 months ago
Activity icon

Replied to Multiple Dropdown In List Of Users

@ideepesh I did try that but the error "Property [$selected_client] not found on component: [auth-users]" occurs. When I add public $selected_client; all change as explained.

Activity icon

Started a new Conversation Multiple Dropdown In List Of Users

I have a list of users created with a foreach loop. List with dropdowns and the dropdowns look like this Dropdowns

<div>
    @foreach($users as $user)
        <div class="bg-gray-100 shadow overflow-hidden sm:rounded-md mb-4">
            <ul class="divide-y divide-gray-200">
               <li>
                    <form wire:submit.prevent="authorise">
                        <div class="flex items-center px-4 py-4 sm:px-6">
                            <div class="min-w-0 flex-1 flex items-center">
                                <div class="min-w-0 flex-1 px-4 md:grid md:grid-cols-2 md:gap-4">
                                    <div>
                                        <p class="text-sm font-medium text-indigo-600 truncate">{{$user->name}}</p>
                                        <p class="mt-2 flex items-center text-sm text-gray-500">
                                            <!-- Heroicon name: mail -->
                                            <svg class="flex-shrink-0 mr-1.5 h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
                                                <path d="M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z" />
                                                <path d="M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z" />
                                            </svg>
                                            <span class="truncate">{{$user->email}}</span>
                                        </p>
                                    </div>
                                    <div class="hidden md:block">
                                        <div>
                                            <p class="text-sm text-gray-900">
                                                Applied on
                                                <time>{{$user->formatted_created_at}}</time>
                                            </p>
                                            <p>
                                                <div>
                                                    <select wire:model="selected_client" name="selected_client" id="selected_client" class="mt-1 block w-full pl-3 pr-10 py-2 text-base border border-gray-500 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md">
                                                        <option value="1000" selected>Engineer</option>
                                                        <option value="2000">Admin</option>
                                                        @foreach($clients as $client)
                                                            <option value="{{$client->id}}">{{$client->client}}</option>
                                                        @endforeach
                                                    </select>
                                                </div>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div>
                                <!-- Heroicon name: chevron-right -->
                                <button class="mt-8 justify-end inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo active:bg-indigo-700 transition ease-in-out duration-150">
                                    Authorise
                                </button>
                            </div>
                        </div>
                    </form>
                </li>
            </ul>
        </div>
    @endforeach
    <div class="mt-6">
        {{ $users->links() }}
    </div>
</div>

When I change 1 dropdown they all change and I understand why this happens. How do I get each dropdown to work independantly?

Thanks Paul

Activity icon

Replied to Error After Upgrading To Tailwindcss 2

This works for me as I'm not using components in this project.

Nov
18
3 months ago
Activity icon

Started a new Conversation Error After Upgrading To Tailwindcss 2

I followed the upgrade instructions on tailwindcss docs but after installing PostCSS 7 compatibility build I get this error when I run npm run development -- --watch

 error  in ./resources/css/app.css

Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: value.charCodeAt is not a function

My tailwind.config.js is

module.exports = {
  future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
  },
  purge: [],
  theme: {},
  variants: {},
  plugins: [
      require('@tailwindcss/ui'),
  ],
}

and my webpack.mix.js

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .postCss('resources/css/app.css', 'public/css', [
    require('tailwindcss'),
    require('autoprefixer'),
    ])
    .browserSync({
        browser: 'google chrome',
        proxy: 'inspect.test',
        host: "inspect.test",
        open: 'external',
        port: 3000,
        notify: false,
        watch: true,
    });

Any help would be appreciated. Paul

Oct
01
5 months ago
Activity icon

Started a new Conversation Laravel And Flutter App Authentication

Im building a Flutter app that will allow users to register and login. I want to authorise that registration in the Laravel back end and once the registration is authorised allow sign in on the device when there is a connection or no connection.

The device will be used in areas with no wifi or mobile data signal. I still want to allow sign in and the data they collect will be stored locally in sqlite and synced when there is signal back to the laravel back end.

I was not sure if I should use Passport or Sanctum. I'm new to mobile apps but I think authorising the registration should allow me to pass a token to the mobile device, store that token locally and check it exists. If it does auto login. The token would also be used to sync back through the laravel api. I'm swaying towards Sanctum but would love to know if anyone else has encountered a similar scenario and how they approached it.