aligajani

aligajani

Member Since 6 Years Ago

London, UK

Experience Points
27,880
Total
Experience

2,120 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
462
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.

Level 6
27,880 XP
Jun
21
3 weeks ago
Activity icon

Replied to Vapor ASSET_URL And Images In Vue

@60days No unfortunately, used what I said above. Worked for me

Jun
17
3 weeks ago
Activity icon

Started a new Conversation Is There A Way To Scaffold An Inertia App On Vue With Auth Views Setup?

Hello everyone,

I am on a quest to try out Inertia on a small project for a client and I was wondering if there is a way to setup the project with scaffolding on authentication such as register, login, forgot password, verify email, reset password etc?

I would love to know if I can speed my development up by getting rid of the grunt work. My intention is to use the latest version of Laravel with the latest version of Intertia.

Regards,

May
14
1 month ago
Activity icon

Started a new Conversation Has Anybody Got Papertrail Working On Laravel Vapor Yet?

I am struggling to sift through logs on Cloudwatch because I like simpler interfaces. Papertrail doesn't work yet.

Activity icon

Started a new Conversation How To Send Errors To Bugsnag While DEBUG=false In Production?

The reason is because I do not like my users seeing exception traces. I am using Laravel 6.18.

Apr
07
3 months ago
Activity icon

Started a new Conversation How To Upload Directly To S3 Using Nova 2.0?

I am using Vapor so files >1MB dont work.

File::make('Information Memorandum File', 'information_memorandum_attachment_full_document_file')
                ->help('Please ensure file is under 20000kb')
                ->rules("file", "max:20000")
                ->disk('s3')
                ->path('tmp')
                ->deletable(false)
                ->disableDownload()
                ->onlyOnForms(),
Mar
30
3 months ago
Activity icon

Started a new Conversation How Does One Use In MYSQL_ATTR_SSL_CA File While Using Vapor?

The problem is, you can't use storage because it gets overridden.

Mar
20
3 months ago
Activity icon

Replied to How Do I Use MYSQL_ATTR_SSL_CA In Vapor When .pem File Is In Storage?

Maybe I can cache it on deployment, maybe I can access it directly via a configuration file?

Activity icon

Started a new Conversation How Do I Use MYSQL_ATTR_SSL_CA In Vapor When .pem File Is In Storage?

It always get deleted when deployed to Vapor as the storage folder is purged.

'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA')
                    ? storage_path() . '/ssl/' . env('MYSQL_ATTR_SSL_CA')
                    : null,
            ]) : [],

I don't want to directly reference it to an s3/cdn asset URL as that will be too slow.

Any tips? PS: It works on local just fine, just not on Vapor.

Mar
10
4 months ago
Activity icon

Started a new Conversation Why Does Nova Still Work If I Disable AuthenticateSession Middleware?

I am bit stunned how Laravel Nova is able to function if I disable the following middleware.

\Illuminate\Session\Middleware\AuthenticateSession::class,

I can still use the app, login, modify data et al.

Mar
09
4 months ago
Activity icon

Replied to How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

@piljac1 So I implemented a Nova::serving and put in a UserObserver inside it. So far it is not colliding, as I am running a piece of code specific to Nova only. Do you know the sequence these run, that is, which event gets fired first? Nova observer event or the one setup in my dispatchEvents within the model?

Activity icon

Replied to How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

@piljac1 Also, wont having 2 saving model events listen to a change conflict or collide?

Activity icon

Replied to How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

@piljac1 thank you. I already do have model events for creating and saved so I guess nova is already triggering those. Except from what I understand you are suggesting stacking up a nova specific one ?

Activity icon

Replied to How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

@piljac1 good one. I already do have model events. Not sure you mean specific to nova ? Could get messy. Any other ideas ?

Activity icon

Replied to How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

@piljac1 Nope. It adds slashes which I don’t want. I tried escaping slashes but even then same. I tried that it with json encode.

Mar
08
4 months ago
Activity icon

Replied to How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

Most of my selects are static, but some are dynamic, like the country selector.

@piljac1 by the way, this is storing it in my database as "{ name: 'Press' }" , correct would be {"name": "Press"}

Activity icon

Started a new Conversation How Can I Instruct Nova To Store The FullUrl Of The S3 Uploads?

  1. This doesn't work because the attachment isn't a valid key.
  2. This is repetitive and I am sure there can be a global way.
->disk('s3')
                ->storeAs(function (Request $request) {
                    $name = sha1($request->attachment->getClientOriginalName()) . '-'
                        . now()->format('D_Y-m-d-T_H-m-s') . '-'
                        . ($request->attachment->getClientOriginalName());
                    $awsBucket = env("AWS_BUCKET");
                    $awsRegion = env("AWS_DEFAULT_REGION");

                    return "https://{$awsBucket}.s3.{$awsRegion}.amazonaws.com/{$name}";
                }),
Activity icon

Started a new Conversation How Can I Have A Select In Nova That Lets Me Store JSON In The Database?

Sorry for the mouthful question, but in my signup page, I have something like this below. When a user selects any of the item from the options below, it gets stored in my database as a JSON value so say I select the 3rd option, it will show up as { name: 'Linkedin' } in my database.

I can technically have more keys inside { name: 'Linkedin' } and it will store that as well, while keeping the name for visibility purposes on the select itself. Is there anything like this possible in Nova, by default?

<SelectInput
                    v-model="form.reference"
                    rules="required"
                    label="How did you hear about us?"
                    :data="[
                        { name: 'Google' },
                        { name: 'Press' },
                        { name: 'Linkedin' },
                        { name: 'Facebook' },
                        { name: 'Twitter' },
                        { name: 'Advert' },
                        { name: 'Paradigm' },
                        { name: 'Referral' },
                        { name: 'Shares Magazine' },
                        { name: 'British Investor Summit' }
                    ]"
                />
Activity icon

Started a new Conversation How Can I Put Nova Dashboard On A Domain Using Vapor

Just a dedicated place like admin.* or admin.test.xyz.com and then admin.xyz.com

Activity icon

Replied to Laravel Nova Broken When Setup On Existing Vue-SPA App

Thanks for that packages site. Appreciated. I have more questions about Nova now.

How do I create a record as the designated user while being logged in as an administrator.

In my code I’m using auth()->user() but as an admin I don’t want to assign a record to myself but the designated user I’m creating a record for.

Activity icon

Replied to Laravel Nova Broken When Setup On Existing Vue-SPA App

@ricus Right, thank you. I just made the below work, however, quite tedious setting it up on a lot of models. I am assuming there isn't any one place where I can put this that gives a super admin full rights. Also, from your experience, what is the best practice to white list a bunch of admins that have same rights i.e. full modification access. I know I can have a column in the database, but I was thinking if having it white list by email using in_array() is a bad idea?

public function before($user, $ability)
{
    if ($user->isSuperAdmin()) {
        return true;
    }
}
Activity icon

Replied to Laravel Nova Broken When Setup On Existing Vue-SPA App

@ricus I just realised that I can't edit other people's records. I do have a Policy setup in my own model but I don't think Nova adheres or observes that and probably needs it own model policies. Am I wrong here?

Activity icon

Replied to Laravel Nova Broken When Setup On Existing Vue-SPA App

@ricus Awesome, setting NOVA_GUARD to web fixed it. I am assuming that Nova brings it own login and reset controllers and doesn't tamper with my existing code in any way , except writing NovaServiceProvider in app.php. Am I right?

Activity icon

Replied to Laravel Nova Broken When Setup On Existing Vue-SPA App

@ricus Thanks, I managed to fix the initial issue by turning on web middlewares that I had earlier commented out. Regarding this particular gate, I did put up an email in there but it refresh the pages, doesn't log me in.

It is the same email that is signed up on JWT in the same browser. I noticed that gate takes into effect non-local environments, and I am on a local environment.

This gate determines who can access Nova in non-local environments.
Activity icon

Started a new Conversation Laravel Nova Broken When Setup On Existing Vue-SPA App

To begin with, I can't create admin users using nova:user because I already have a user model which doesn't have a name field and has dozens of other fields which are required. Another problem is the error below which I can't figure out at all.

Facade\Ignition\Exceptions\ViewException Call to a member function any() on string (View: /Users/aligajani/Sites/shadow-platform/nova/resources/views/auth/login.blade.php) https://shadow-platform.test:3000/nova/login

https://flareapp.io/share/17DMdZ5v

Did I just make a big mistake paying $99 for a dashboard that isn't supposed to work on existing SPA apps?

Feb
25
4 months ago
Activity icon

Replied to How Can I Setup Nova Outside Of My Laravel App On A Separate Vapor App?

I didn't mean getting a separate frontend developer to work on Nova. What I mean is the possibility of putting Nova in a separate repo and feeding off from that repo while deploying it to vapor.

Activity icon

Started a new Conversation How Can I Setup Nova Outside Of My Laravel App On A Separate Vapor App?

I am not happy with making my application a big monolith. Ideally, I want someone else to work on the dashboard which means having Nova in a separate repository would be perfect for me.

Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

@georgeboot Thanks George, but it didn't help me with assets references in .vue files.

Feb
22
4 months ago
Activity icon

Replied to Vapor ASSET_URL And Images In Vue

@georgeboot How does that fix it for assets referenced inside .vue files? It didn’t work for me. I am picking up the ASSET_URL from index.blade.php , using it in a method as a global mixin called CDN() and using that in my .vue files instead. Works but surely there’s a better way.

Feb
21
4 months ago
Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

@georgeboot mix.setResourceRoot(ASSET_URL); doesn't fix the asset references in .vue files though (?)

Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

@georgeboot What's your entire code block for this mix.setResourceRoot(ASSET_URL) please?

Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

@georgeboot

I use MIX_BASE_URL for making a reference to my API endpoint over here below.

window.axios.defaults.baseURL = process.env.MIX_BASE_URL;

I have put this in Github Secrets for now, because .env doesn't get committed to source control.

Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

@georgeboot How are you getting MIX_BASE_URL to work ? Where are you setting that? My bootstrap.js needs that but currently I've set that up in Github Secrets as a hack.

Feb
13
4 months ago
Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

@georgeboot I contacted Github a while ago and they have no clue either.

Feb
12
5 months ago
Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

The problem is with Github Actions guys...has anyone managed to access anything process.env.* while using Vapor deploy in Github Actions. I haven't. So I am, as a fall back, using the window.asset_url={} technique and for also using Github secrets. So my MIX_BASE_URL is in Github Secrets. Only then, it is accessible by the workflow while using process.env. Otherwise, Github Actions just returns undefined.

Feb
11
5 months ago
Activity icon

Replied to Why Doesn't Laravel Vapor Inject ASSET_URL In My Build Step?

Did that work? On Github actions ?

Jan
16
5 months ago
Activity icon

Replied to How Do You Standardize Your JSON Responses?

That is an overkill for what I wanted. So I used another one now, flug-responder. So good

Jan
15
5 months ago