agilasadi

agilasadi

Software Engneer at Raplet

Member Since 2 Years Ago

Azerbaijan, Lankaran

Experience Points
8,860
Total
Experience

1,140 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
72
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 2
8,860 XP
Oct
12
1 month ago
Activity icon

Started a new Conversation How To Make Requested Data To Available For Multiple Components.

I have this page where I have categories and then categories has posts, I get the categories through axious like:

            axios
                .get('api/categories')
                .then(response => (this.categories = response.data.categories));

I then try to use that data in the categories section, which is no issue but when I try to also loop through posts I do not know how to access that same data.

I do not want to do another API request to getposts currently.

Here is how my script section looks inside the component at the moment:

    export default {
        data()
        {
            return {
                categories: null,
            }
        },
        mounted()
        {
            axios
                .get('api/categories')
                .then(response => (this.categories = response.data.categories));
        }
    }

I'm sorry for my lack of knowledge, I had problems finding proper guidance to learn how to use Vue with Laravel

If my question is far from being a proper question, then you can also give me a direction to take or a guide where I can figure things out on my own.

Oct
09
1 month ago
Activity icon

Commented on The Need For Computed Properties

I have no idea how you come up with these ideas of making things so simple and. And I should say, you go through the steps so good I almost feel like I'm hypnotized.

Sep
18
1 month ago
Activity icon

Replied to Update And Performance Optimisation

It will update, to confirm that you can try updating the data and check the database to see if updated_at field changes.

Activity icon

Started a new Conversation GetActionMethod() In __construct Breaks `php Artisan Route:list`

So recently I used the getActionMethod() function on my controller __construct(), it seems to work properly, but when I run php artisan route:list it throws Call to a member function getActionMethod() on null.

Here is my usage:


$this->method = request()->route()->getActionMethod()

Aug
24
2 months ago
Activity icon

Replied to How To Publish And Register An Extra Service Provider In Laravel Package

I see I will give it a shot in the next update.

Aug
22
2 months ago
Activity icon

Replied to How To Publish And Register An Extra Service Provider In Laravel Package

Ok, so this service provider enables the functionality to manage authentication method, I would like to modify it once I pull in package.

The above code is an example, I know how to register a service provider, and I know it won't work.

But somehow in Nova there is a NovaServiceProvider that gets published and registered. I could not entirely figure it out.

Activity icon

Started a new Conversation How To Publish And Register An Extra Service Provider In Laravel Package

I would like to publish an extra service provider into App/Providers/ and then register it. The problem is I'm supposed to register it in register() function while I should publish it in boot() function. How should I accomplish that?

Here is what I'm going to publish:

public function boot()
{
    if ($this->app->runningInConsole())
    {
        $this->publishes([
            __DIR__ . '/Console/stubs/SomeServiceProvider.stub' => 
            app_path('Providers/SomeServiceProvider.php'),
        ], 'wire-provider');
    }
}

Here is how I would presumably register it if was published properly:

public function register()
{

    $this->app->register(App\Providers\SomeServiceProvider::class);
}

I would like to point this out, this service provider is not the main service provider for the package, and it's not in the project by default, it should be published first.

Aug
17
2 months ago
Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

The only thing in middleware is that it checks to see if the user is authenticated. On the other hand, I think you might have detected the issue, there is folder called wire in public directory :/ gotta rename it and try to see what happens. That is probably the issue

Aug
16
2 months ago
Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

This is what you are looking for. it's right there on the third line @dunsti

|        | GET|HEAD | wire                           | wire.dashboard    | App\Wire\Http\Controllers\[email protected]               | web,wire_interface |
Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

+--------+----------+--------------------------------+-------------------+-----------------------------------------------------------------------+--------------------+ | Domain | Method | URI | Name | Action | Middleware | +--------+----------+--------------------------------+-------------------+-----------------------------------------------------------------------+--------------------+ | | GET|HEAD | / | | Closure | web | | | GET|HEAD | api/user | | Closure | api,auth:api | | | GET|HEAD | wire | wire.dashboard | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | GET|HEAD | wire/login | wire.login | App\Wire\Http\Controllers\Authentication\[email protected] | web | | | POST | wire/login | wire.attemptLogin | App\Wire\Http\Controllers\Authentication\[email protected] | web | | | GET|HEAD | wire/logout | wire.logout | App\Wire\Http\Controllers\Authentication\[email protected] | web,wire_interface | | | GET|HEAD | wire/{identifier} | wire.index | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | POST | wire/{identifier} | wire.store | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | GET|HEAD | wire/{identifier}/create | wire.create | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | GET|HEAD | wire/{identifier}/recycle | wire.recycle | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | GET|HEAD | wire/{identifier}/restore/{id} | wire.restore | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | GET|HEAD | wire/{identifier}/show/{id} | wire.show | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | DELETE | wire/{identifier}/{id} | wire.destroy | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | PUT | wire/{identifier}/{id} | wire.update | App\Wire\Http\Controllers\[email protected] | web,wire_interface | | | GET|HEAD | wire/{identifier}/{id}/edit | wire.edit | App\Wire\Http\Controllers\[email protected] | web,wire_interface | +--------+----------+--------------------------------+-------------------+-----------------------------------------------------------------------+--------------------+

Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

No, it does not, I'm trying it in a new laravel application. And actually tried in multiple applications

Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

It throwes The requested resource /wire was not found on this server.

Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

Yeap, that is exactly what I'm trying to say :)

Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

I'm telling by route name, can you please Ctrl+f wire.dashboard

Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

wire.dashboard route is before {identifier} route, I would expect it to be run before it

Activity icon

Replied to When A Route URL Is Same As The Package Name, That URL Does Not Work

No problem, here is what my rout looks like currently

<?php
Route::group(['namespace' => 'App\Wire\Http\Controllers', 'middleware' => 'web', 'prefix' => 'wire'], function () {
    Route::get('login', 'Authentication\[email protected]')->name('wire.login');
    Route::post('login', 'Authentication\[email protected]')->name('wire.attemptLogin');

    Route::group(['middleware' => 'wire_interface'], function () {
            Route::get('/', '[email protected]')->name('wire.dashboard');

            Route::get('logout', 'Authentication\[email protected]')->name('wire.logout');

            Route::get('{identifier}', '[email protected]')->name('wire.index');
            Route::post('{identifier}', '[email protected]')->name('wire.store');
            Route::get('{identifier}/create', '[email protected]')->name('wire.create');
            Route::get('{identifier}/recycle', '[email protected]')->name('wire.recycle');
            Route::get('{identifier}/restore/{id}', '[email protected]')->name('wire.restore');
            Route::delete('{identifier}/{id}', '[email protected]')->name('wire.destroy');
            Route::put('{identifier}/{id}', '[email protected]')->name('wire.update');
            Route::get('{identifier}/show/{id}', '[email protected]')->name('wire.show');
            Route::get('{identifier}/{id}/edit', '[email protected]')->name('wire.edit');
    });
});

In this case, wire.dashboard route would not work

Aug
15
3 months ago
Activity icon

Replied to Laravel 5 Package ServiceProvider Can't Be Found!

I'm running into a similar problem, know it has changed quite a bit since then.

I'm trying to make my first package as well.

Here is the package URL in Packagist: https://packagist.org/packages/rapkit/wire

and this is the GitHub URL: https://github.com/rapkit/wire

I tried a few things to fix it but now I have no idea about what to do. also, I don't want to do a lot of unnecessary pushes to the repository.

Since it's working in my development environment but when I try to pull it into a new project, it starts throwing ServiceProvider not founded error.

Aug
14
3 months ago
Activity icon

Started a new Conversation When A Route URL Is Same As The Package Name, That URL Does Not Work

I have a lot of URLs in my package routes, but one of them does not seem to work. When the route is as follows:


Route::get('package_name', '[email protected]');

It does not work, if I try to access localhost:8000/package_name then I get:

The requested resource /package_name was not found on this server.,

but when it's something as below:


Route::get('something', '[email protected]');

Then it works with no problem.

Also, when I run php artisan route:list the route is there as expected.

Aug
12
3 months ago
Activity icon

Commented on Package Development

I would love to see an updated version of this video

Aug
09
3 months ago
Activity icon

Replied to [L5] Register A Route Middleware At Package

Did that change since than?

Jun
22
4 months ago
Activity icon

Replied to Listen To *any* Save/update/create Event For *any* Model?

@KFIRBA - I don't think those events would work that way, whenever I place another event within the same trait, it no longer listens to the remaining part of the trait

Jun
01
5 months ago
Activity icon

Replied to It Seems Like Laravel Boot Trait Doesn't Work

Here is what I ended up doing, works perfectly well


    public static function boot()
    {
        self::created(
            function($model)
            {
                Contribution::create([
                    'contributing_id' => $model->id,
                    'contributing_type' => $model->table
                ]);
            }
        );
    }

Activity icon

Replied to It Seems Like Laravel Boot Trait Doesn't Work

Here is the thing, dd() works inside the trait, but it does not work inside the static::creating

Activity icon

Replied to It Seems Like Laravel Boot Trait Doesn't Work

@TALINON - No, I do not have boot in my model

Activity icon

Replied to It Seems Like Laravel Boot Trait Doesn't Work

@SNAPEY - If it has the id or not, just to make sure creating the record is successful, but the code doesn't reach to that point, creating does not get triggered

Activity icon

Replied to It Seems Like Laravel Boot Trait Doesn't Work

@SNAPEY - It's quite the same as mine, but for some reason, it doesn't work. By the way, I think this method feels a lot cleaner

Activity icon

Replied to It Seems Like Laravel Boot Trait Doesn't Work

@JOHNBRAUN - Nothing, it ignores the event entirely, but when I put dd before the event, it shows up when the page is loading

Activity icon

Started a new Conversation It Seems Like Laravel Boot Trait Doesn't Work

Recently I'm having problems with using traits, I created some before and it seemed to work, but now I created another one to take action on a creating event, here it is


trait Contributes
{

public static function bootContributes()
{
    static::creating(function ($model) {
        if (!$model->getKey())
        {
            Contribution::create([
                'contributing_id' => $model->id,
                'contributing_type' => $model->class_table,
            ]);
        }
    });
}

}

and I included it in multiple models like use Contributes; I think there is something I don't know about it.

May
31
5 months ago
Activity icon

Started a new Conversation Laravel Nova Access Restriction Vie Gate Does Not Work

I tried to restrict access to Nova depending on user role. Although It seems like I did everything according to the documentation, Nova seems to ignore it.

    protected function gate()
    {
        Gate::define('viewNova', function ($user) {
            return in_array($user->role_id, [
                '1'
            ]);
        });
    }
May
16
5 months ago
Activity icon

Replied to Nova Actionable_id Cannot Be Null

@DEVFREY - Shoot, that is it. :D Thanks for your assistance <3

Activity icon

Replied to Nova Actionable_id Cannot Be Null

@DEVFREY - I didn't try that be clearly, generating guid with a trait was the problem. It worked just by disabling the trait which I'm absolutely not happy with :/

Activity icon

Replied to Nova Actionable_id Cannot Be Null

So here is the trait I added for the Model:

trait UsesUuid
{
    protected static function bootUsesUuid()
    {
        static::creating(function ($model) {
            if (!$model->getKey())
            {
                $model->guid = (string)Str::uuid();
            }
        });
    }

    public function getIncrementing()
    {
        return false;
    }

    public function getKeyType()
    {
        return 'string';
    }
}

it seems like disabling trait lets this work.

How else I can generate the guid field?

Activity icon

Replied to Nova Actionable_id Cannot Be Null

@devfrey here is the fields for the Site resource:


            ID::make()
                ->hideWhenCreating()
                ->hideWhenUpdating(),

            Text::make('Guid')
                ->withMeta(['value' => (string)Str::uuid()]),

            Text::make('Site Title')
                ->creationRules('required'),

            Text::make('Site Contents')
                ->creationRules('required'),

            Number::make('Record Priority'),

            Select::make('Record State')->options([
                '1' => 'Active',
                '0' => 'Disabled',
                '2' => 'Draft',
            ])->displayUsingLabels(),

            BelongsTo::make('Created By', 'creator', 'App\Nova\User')
                ->creationRules('required'),

            BelongsTo::make('Updated By', 'updater', 'App\Nova\User')
                ->creationRules('nullable'),

            HasMany::make('Sites', 'roles', 'App\Nova\RoleSites')

I can share model as well if you want to see it

Activity icon

Replied to Nova Actionable_id Cannot Be Null

@munazzil As @devfrey mentioned, it's created_by which corresponds to the creator of the record

Activity icon

Replied to Nova Actionable_id Cannot Be Null

@devfrey As far as I remember I didn't do anything like that

Activity icon

Started a new Conversation Nova Actionable_id Cannot Be Null

Apparently none of my create functions is working, the all keep throwing:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'actionable_id' cannot be null (SQL: insert into `action_events` (`batch_id`, `user_id`, `name`, `actionable_type`, `actionable_id`, `target_type`, `target_id`, `model_type`, `model_id`, `fields`, `status`, `exception`, `updated_at`, `created_at`) values (8db303d9-39ca-4858-8d59-30ec1cd51cb7, 1, Create, App\Models\Site, ?, App\Models\Site, ?, App\Models\Site, ?, , finished, , 2019-05-16 09:47:12, 2019-05-16 09:47:12))

Basically, it says 'actionable_id' can not be 'null'`.

Here is a sample of my table:


            $table->bigIncrements('id');
            $table->string('guid')->unique();

            $table->string('site_title');

            $table->string('site_contents')->nullable();

            $table->integer('record_priority')->default('0');
            $table->integer('record_state')->default('1');
            $table->string('created_by');
            $table->string('updated_by')->nullable();

            $table->softDeletes();
            $table->timestamps();

I generate guid with trait, but for the sake of making this work, I even tried it manually, no luck.

It works just fine when I create it with tinker.

May
13
6 months ago
Activity icon

Replied to Fields In Nova For Inserting Data With Child Table

I see thanks for your help <3

Activity icon

Replied to Fields In Nova For Inserting Data With Child Table

Should I also have a model and Nova Resource for the child table?

Activity icon

Replied to Fields In Nova For Inserting Data With Child Table

How am I going to have multiple fields for inserting that role translations?

Activity icon

Started a new Conversation Fields In Nova For Inserting Data With Child Table

I have quite a little experience with the capabilities of Nova, but recently I started working on a multi-lingual application with Nova. Here is the point where I got stuck.

My table structure is somewhat like below:


        Schema::create('roles', function (Blueprint $table) {
            $table->bigIncrements('auto_id');
            $table->string('id');

            $table->timestamps();
            $table->softDeletes();
        });

        Schema::create('role_translation', function (Blueprint $table) {
            $table->string('role_id');
            $table->string('translation_id');

            $table->string('role_name');
            $table->string('role_description')->nullable();

            $table->string('created_by');
            $table->string('updated_by')->nullable();

            $table->timestamps();
            $table->softDeletes();
        });

Now when I insert into roles I also need to insert into role_translations I don't know how to provide fields for Nova to give me the desired interface.

Activity icon

Replied to Hasone RelationsShip (Create View) - Laravel Nova

I don't feel comfortable with this solution, to be honest. But thanks for sharing.