nikocraft

nikocraft

Member Since 2 Years Ago

Experience Points 25,950
Experience
Level
Lessons Completed 89
Lessons
Completed
Best Reply Awards 5
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

29 Oct
1 month ago

nikocraft left a reply on Is Naming Columns With Reserved Words Problematic?

@jlrdw you make no sense

So your custom framework does escape it, but Laravel does not then you say check the vendor you bet Taylor does escape it.

What did you really mean :)

nikocraft started a new conversation Is Naming Columns With Reserved Words Problematic?

For example, in pure PHP this guy has a problem because he has a column named key

https://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word-as-a-table-or-column-name-in-mysql

However, I am using both key and value for column names in my application which I have developed for 15 months now and never did I have any single problem with these names. I probably use some more reserved words.

Is Laravel escaping them with backtick as the answer suggests one should do manually? If Laravel is not escaping them how come I can use any name for the column in a table and not get problems like in the link above?

27 Oct
1 month ago

nikocraft left a reply on Can't Use OR In Blade Template

thanks guys, that was fast! :)

nikocraft started a new conversation Can't Use OR In Blade Template

When I am developing locally on win10 php7.2 nginx expression like this works just fine

    <div class="{{ $menuclass or 'menu'}}">

which gives

    <div class="menu">

but as soon as I deploy it via laravel forge to ubuntu machine it fails to work and I get this

    <div class="1">

It seems that instead of doing this:

    isset($menuclass ) ? $menuclass : 'menu'

it just returns 1

Any ideas why?

This feature was blogged about here: https://laravel-news.com/blade-or-operator

Has it been deprecated in later versions of laravel?

28 Sep
2 months ago

nikocraft left a reply on Filter An Eloquent MorphMany Relation By Morphable?

Ping, I need an answer to this question as well. How do you skip having to use two where to get the specific type and specific ID? Is there smoother way that Laravel offers to get polymorphic relationship?

12 Sep
3 months ago

nikocraft started a new conversation API Question: Can I Store Oauth Client_secret On Server Instead Of Sending It From The Frontend Client So Everyone Can See It?

I am building a client that will consume api. Using Laravel and vuejs for this. Backend is it's own app and frontend client is its own app that will run on vuejs.

Right now when I want to login user to the backend I have to send this data from client:

                form: {
                    'grant_type' : 'password',
                    'username': '[email protected]',
                    'password': 'pass1234',
                    'provider': 'student',
                    'client_id': "2",
                    'client_secret' : 'fXz4bILqz5CnDjFCvXpw7RZWLgWXxsTa0LN1'
                }

How smart or dangerous is it to save secret in client like this? Now everyone can see it, can they use this in some way? And if its dangerous how is everyone else doing it? If you are not sending secret from the client, then where do you keep it?

15 Aug
3 months ago

nikocraft left a reply on Using Laravel Accessors In A Vue Layout

the above is the only solution, once appeneded, they will always follow :)

nikocraft started a new conversation Laravel Connection: Sqlite, Database: Memory Leads To Could Not Find Driver

I'm running laravel on win10, so I cant really run

sudo apt-get install php7.1-sqlite3 as pointed out here:

Laravel - Could not find driver exception with sqlite

I am trying to run some tests with phpunit and inside one of tests I've done:

class ViewConcertListingTest extends TestCase { use DatabaseMigrations;

and inside phpunit.xml

I've added these two

<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>

What can I do to get laravel to be able to use sqlite and memory database?

11 Aug
4 months ago

nikocraft left a reply on How Does Everyone Sync Their MorphToMany Relationships?

there is also morphToMany which is basically manyToMany relationship but on polymorphic models :)

If we have sync for many-to-many why not morphToMany as well?

nikocraft left a reply on How Does Everyone Sync Their MorphToMany Relationships?

Maybe I am thinking wrong here, why do we for example have sync for manyToMany relationships at all in Laravel but not for morphToMany?

10 Aug
4 months ago

nikocraft left a reply on How Do I Select MorphToMany Relationship Based On The Morphable Type?

you don't post for 10 months and you help me, thank you @Abi appreciated! :)

nikocraft started a new conversation How Do I Select MorphToMany Relationship Based On The Morphable Type?

I want to do something like this:

Tag::where('taggable_type', 'App\Models\Core\Media\Image')->get()

Image model has Tags, which are defined like

public function tags()
{
    return $this->morphToMany(Tag::class, 'taggable');
}

And then we have two migrations

    Schema::create('tags', function (Blueprint $table) {
        $table->increments('id');
        $table->string('title');
        $table->string('slug')->unique();
        $table->timestamps();
    });

and

    Schema::create('taggables', function (Blueprint $table) {
        $table->integer('tag_id');
        $table->integer('taggable_id');
        $table->string('taggable_type');
    });

so ofc I cant do this Tag::where('taggable_type', 'App\Models\Core\Media\Image')->get()

since tag model it self does not have taggable_type, but the polymorph pivot table has. How can I query tag table but let it only return stuff where taggable_type is of this 'App\Models\Core\Media\Image'?

nikocraft started a new conversation How Does Everyone Sync Their MorphToMany Relationships?

How do you sync them?

Do you just detach and then attach again? Why do we not have sync method for toMany polymorphic relationships? Is this method hard to implement correctly for polymorphic models?

02 Jul
5 months ago

nikocraft left a reply on Setting Up Lets Encrypt On Forge

hi so once this is done I can access https://mysite.com

do I need to tell laravel to run everything over https or will it automatically work? I've done this over a year ago but I forgot the details. Greatfull for any tips in case extra steps are needed after Lets Encrypt has been installed :)

01 Jul
5 months ago

nikocraft started a new conversation How To Turn Of Phpinfo On Freshly Deployed Forge Server?

if server is accessed directly by ip in browser it displays phpinfo, how can this be turned off?

nikocraft left a reply on How Good Is Forge Support From Your Perspective?

seems like Stripe has really some bad algorithms to block a valid bussiness card. Why does paypal never have the same problem :) I never got this with them.

nikocraft started a new conversation How Good Is Forge Support From Your Perspective?

I'm wondering about Forge support, do they allways respond? I've read on reddit that some questions go unanswered, has it happened to any of you?

I've tried to sign up to business plan and I got a message saying that it failed and that I should get in touch with Stripe to check why.

I tried reaching out to Said, the guy Taylor hired as laravel first employe. I reached out to him about this on twitter 18 hours ago and he did not care to even respond.

I guess they must be too busy and dont care about some of this stuff.

What is your experience? Is support good, how long before Taylor answers? I guess he is the one answering most support questions?

27 Jun
5 months ago

nikocraft left a reply on How To Tell Laravel To Automatically Decode Urls

how do I access incoming paramters and then push them back in?

TrimStrings looks like this

class TrimStrings extends Middleware
{
    /**
     * The names of the attributes that should not be trimmed.
     *
     * @var array
     */
    protected $except = [
        'password',
        'password_confirmation',
    ];
}

nikocraft started a new conversation How To Tell Laravel To Automatically Decode Urls

How do I tell laravel to automatically turn this

http://laraone.oo/backend/activate/8%3Fexpires%3D1530213677

into this

http://laraone.oo/backend/activate/8?expires=1530213677

I am currently getting the first type of link when I submit something via post method from the vue, and if I remember correctly there is somewhere in laravel a place where I can enable laravel to conver all first type of links into second type of links before it starts extracting them and parsing them.

nikocraft started a new conversation How To Verify Signed Url When Submiting As Post Via Vuejs?

I am using laravels signedRoutes and I have signed a route on the server and now I need to submit this route again to the server but from the client which is in javascript. Below code is what I have before I send it to the server.

                        let formData = {
                            signature: '51bd52ece280dd29857aa7443e9178e64cf27047e831f4cdfd32c951c4571f65',
                            testing: '12345',
                            expires: '1530209048',
                            user: '7',
                            password: this.password,
                            passwordConfirm: this.passwordConfirm
                        }

return axios.post(route('backend.user.activate'), formData)

When I recieve this on the server I do

    public function activate(Request $request)
    {
        if ($request->hasValidSignature()) {
            dd('we cool!');
        }

"we cool!" does not print for me, which means Laravel has problem to verify the valid signature when sent as a post.

I also tried attaching like this

return axios.post(route('backend.user.activate', urlSignature), formData)

where urlSignature="7?expires=1530209048&testing=12345&signature=51bd52ece280dd29857aa7443e9178e64cf27047e831f4cdfd32c951c4571f65"

but laravel still fails to verify that signature is valid, which it is, since it works over simple route like this

Route::get('/activate/{user}', 'Auth\[email protected]')->name('backend.user.activate.show');

but as soon as I go to post

Route::post('/activate/{user}', 'Auth\[email protected]')->name('backend.user.activate');

it fails.

I need to use the post, since I must send password in the post and I do not wish to send it via get request.

26 Jun
5 months ago

nikocraft left a reply on How To Override Auth Login Function In Laravel?

@jlrdw hi, how are things in the future, are Marty and Doc still around? Is everything ok with Earths gravity?

nikocraft left a reply on How To Override Auth Login Function In Laravel?

Ok this is final function if anyone from the future wonders what the solution was:

    public function login(Request $request)
    {
        $this->validateLogin($request);

        if ($this->hasTooManyLoginAttempts($request)) {
            $this->fireLockoutEvent($request);

            return $this->sendLockoutResponse($request);
        }

        if($this->guard()->validate($this->credentials($request))) {
            if(Auth::attempt(['email' => $request->email, 'password' => $request->password, 'is_activated' => 1])) {
                // return redirect()->intended('dashboard');
            }  else {
                $this->incrementLoginAttempts($request);
                return response()->json([
                    'error' => 'This account is not activated.'
                ], 401);
            }
        } else {
            // dd('ok');
            $this->incrementLoginAttempts($request);
            return response()->json([
                'error' => 'Credentials do not match our database.'
            ], 401);
        }
    }

this part validates the correct credentials but does not login the user: if($this->guard()->validate($this->credentials($request)))

this part logs-in the user if all requirments are met:

if(Auth::attempt(['email' => $request->email, 'password' => $request->password, 'is_activated' => 1]))

nikocraft left a reply on How To Override Auth Login Function In Laravel?

Actually its good except we got another problem now.

If user creditials do not match what is found in the database now user will only get back "This account is not activated." error message, which may not be true. Any idea how to solve this problem? I have to show the user correct error message.

nikocraft left a reply on How To Override Auth Login Function In Laravel?

yes it was very usefull :) thanks!

Btw if anyone in future wonders what I did, here is how I solved it

I still had to override the login function inside LoginController.php this had to be done so I get all the throttling and error messages that can be generated by the system. Here is my final function

    public function login(Request $request)
    {
        $this->validateLogin($request);

        if ($this->hasTooManyLoginAttempts($request)) {
            $this->fireLockoutEvent($request);

            return $this->sendLockoutResponse($request);
        }

        if(Auth::attempt(['email' => $request->email, 'password' => $request->password, 'is_activated' => 1])) {
            // return redirect()->intended('dashboard');
        }  else {
            $this->incrementLoginAttempts($request);
            return response()->json([
                'error' => 'This account is not activated.'
            ], 401);
        }

        $this->incrementLoginAttempts($request);
        return $this->sendFailedLoginResponse($request);
    }

@BishoyWagih if you think it could have been even more simplified plz let me know :)

nikocraft left a reply on How To Override Auth Login Function In Laravel?

ok I see now, example is in the documentation. Thanks :)

nikocraft left a reply on How To Override Auth Login Function In Laravel?

and how exactly do I tell attempt to also check the is_activated field

What would I put here inside attempt so it checks additional column for true or false?

        return $this->guard()->attempt(
            $this->credentials($request), $request->filled('remember')
        );

nikocraft left a reply on How To Override Auth Login Function In Laravel?

You are correct I want to check for is_activated. I did this for now:

I copied the whole login function into LoginController.php and this is the interesting part

        if ($this->guard()->validate($this->credentials($request))) {
            $user = $this->guard()->getLastAttempted();
            if ($user->is_activated && $this->attemptLogin($request)) {
                return $this->sendLoginResponse($request);
            } else {
                $this->incrementLoginAttempts($request);
                if ($request->ajax()) {
                    return response()->json([
                        'error' => 'This account is not activated.'
                    ], 401);
                }
            }
        }

If I do it as you suggest, how can I also generate the error message as above only if is_activated is false on that particular user?

nikocraft started a new conversation How To Override Auth Login Function In Laravel?

I need to override laravels default login function, however I am confused by the code I find there. I do not understand how laravel AuthenticatesUsers.php verifies that user exists in db and then authenticates the user.

I've come to this function in AuthenticatesUsers

    /**
     * Attempt to log the user into the application.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    protected function attemptLogin(Request $request)
    {
        return $this->guard()->attempt(
            $this->credentials($request), $request->filled('remember')
        );
    }

I guess I would need to override this function inside auth/LoginController.php

but I do not understand how it works. Where are guard() and attempt() implemented, I guess the real action happens there. I need to add another condition to the login.

Anyone understands how laravels default login works? and those two functions guard() and attempt(), for example attempt is not implemented inside AuthenticatesUsers.php it self and I belive its this function I should really override.

Where can I find it's implementation?

04 Jun
6 months ago

nikocraft left a reply on Making A Laravel 5.4 Query On A JSON Field Containing A JSON Array

I got a similar problem. Here is my case:

Inside users table I have a json column named "agencies" that stores data as a simple array like this:

[
"0eb2edf0-50cb-44ff-a0a6-b2a104a9dc12",
"f7c748d4-8718-441e-aa69-91b890ead5ed"
],

the above is valid json. When I try to select all users that contain 0eb2edf0-50cb-44ff-a0a6-b2a104a9dc12 I get null

Is my query correct?

$users = User::whereRaw('JSON_CONTAINS(agencies->"$[*]", "0eb2edf0-50cb-44ff-a0a6-b2a104a9dc12")')->get();

is the below correct way to do write JSON select query considering how I store uuids as an array inside agencies column which is defined as json?

'JSON_CONTAINS(agencies->"$[*]", "0eb2edf0-50cb-44ff-a0a6-b2a104a9dc12"

I looked at the original stackoverflow answer posted above and modified it to this agencies->"$[*]" but it does not seem to be working for me.

Using Laravel 5.4

I'd appreciate if you guys had any ideas what may be wrong in my case?

26 May
6 months ago

nikocraft started a new conversation Call Artisan Command That Has No Name For The One And Only Option

How would I execute command like this from the Controller:

Package I am using that gives the below artisan commands: https://github.com/JosephSilber/page-cache

php artisan page-cache:clear {slug}

for example if typed manually

php artisan page-cache:clear about-us

Laravel docs gives us this: https://laravel.com/docs/5.6/artisan#programmatically-executing-commands

Artisan::call('email:send', [
    'user' => 1, '--queue' => 'default'
]);

Since the artisan command page-cache:clear does not take any named parameters, how do I send the slug parameter to it?

I've tried this:

Artisan::call('page-cache:clear ' . $content->slug);

and get back this error:

Command "page-cache:clear hem" is not defined.↵↵Did you mean this?↵    page-cache:clear

and also I've tried this:

Artisan::call('page-cache:clear', [$content->slug]);

but then slug is not added and it calles

php artisan page-cache:clear without slug so this package clears all the cached files.

23 May
6 months ago

nikocraft left a reply on How To Go From Http To Https, Certificate Already Installed And Https Is Working...

@cronix

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ / [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

I placed it at the end of .httaccess that comes with laravel but it gives an error:

The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

nikocraft left a reply on How To Go From Http To Https, Certificate Already Installed And Https Is Working...

nice, but why layout.app, why not web.php where it would be more elegant to keep that code at top?

nikocraft started a new conversation How To Go From Http To Https, Certificate Already Installed And Https Is Working...

if someone directly enters www.myapp.com the browser will take them to http://www.myapp.com

myapp is configured to work with https so if we enter manually https://www.myapp.com then there are no problems laravel generates https urls correctly?

how do I get browser to go to https when user just enters www.myapp.com instead of browser taking them to the http?

Where is the most elegant place to make this happen?

10 May
7 months ago

nikocraft left a reply on Will Laravels Packages Also Work On Lumen?

sorry name of that package confused me, I thought it would execute on the client and not on server, actually link I post first is wrapper for the htmlpurifier! :)

nikocraft left a reply on Will Laravels Packages Also Work On Lumen?

there is also a postman that hacker can use to post something to an endpoint :)

nikocraft started a new conversation Will Laravels Packages Also Work On Lumen?

I'm interested in Purifier package which is used to clean up the input from the user, and wonder if I can use it on Lumen

https://github.com/mewebstudio/Purifier

What is everyone else using to sanitize input in Lumen?

05 May
7 months ago

nikocraft left a reply on How To Print Curly Braces From Database

thats great! thanks for update :) we all use vuejs now in our projects and I will soon need this again, so its just purefect! :)

24 Mar
8 months ago

nikocraft left a reply on SQLSTATE[HY000]: General Error: 1215 Cannot Add Foreign Key Constraint Laravel

@snapey you never had to do anything like this? for parent-child in the same table?

@cornix I figured out the problem, I had to add unique() to the id column, it wont assign it without that.

nikocraft started a new conversation SQLSTATE[HY000]: General Error: 1215 Cannot Add Foreign Key Constraint Laravel

I am trying to make a foreign key in the same table and no matter what I test I get an error.

This is my code

        Schema::create('trip_tags', function (Blueprint $table) {
            $table->uuid('uuid')->unique();
            $table->integer('id')->unsigned();
            $table->string('name')->nullable();
            $table->integer('parent')->unsigned()->nullable();

            $table->timestamps();
        });

        Schema::table('trip_tags', function (Blueprint $table) {

            $table->foreign('parent')
                ->references('id')
                ->on('trip_tags')
                ->onDelete('cascade');
        });

I try to point parent to id, both are unsigned integers, I guess the reason that creating the foreign key fails is that they are not compatible in some way, I cant figure out what is wrong.

I tried to point parent to uuid but then had to make it a string and that worked. But I have to have the parent point to id which is integer and I cant get it to migrate withour error.

05 Mar
9 months ago

nikocraft left a reply on Remove Cache By Asterix

hi @lostdreamer_nl

thanks for the help, I am using file driver, thats not a bad idea.

I am aware of separation of logic and rendering etc, however there exist cases when you have to to some stuff that is against the norm.

I am building a cms that has themes, themes that can be built by other authors then my self, themes can have locations for the menu, for example primary, secondary, footer, whatever.

Since I in the forhand do not know if they will even support a particular location and locations names are up to theme author I can't in the controller do the selection of the menu and menu items. I have to do it from views, and the code above is actually not in the view eitherm, its in a component, component may technically be a view, but components in my opnion should be able to have some logic in them, specially if you can't put that logic in Controller.

04 Mar
9 months ago

nikocraft started a new conversation Remove Cache By Asterix

Hi

I create cache like this:

        @foreach ($menu->items as $key => $item)
            <div class="{{ $itemclass or 'menu-item'}}">
                @switch($item->type)
                    @case("CustomUrlItem")
                        <a href="{{ $item->meta }}">{{ $item->title }}</a>
                    @break

                    @case("PageItem")
                        @php
                            $page = Cache::rememberForever('menu-item-'.$item->meta, function() use($item) {
                                return Content::find($item->meta);
                            });
                        @endphp
                        <a href="{{ $page->slug }}">{{ $item->title }}</a>
                    @break

                @endswitch
            </div>
        @endforeach

if we focus specifically on this part:

                    @case("PageItem")
                        @php
                            $page = Cache::rememberForever('menu-item-'.$item->meta, function() use($item) {
                                return Content::find($item->meta);
                            });
                        @endphp
                        <a href="{{ $page->slug }}">{{ $item->title }}</a>
                    @break

When I want to remove cache for all 'menu-item-*' how could I do that.

Right now if I want to remove cache for menu-item-*

Cache::forget('menu-item-1');
Cache::forget('menu-item-2');
Cache::forget('menu-item-3');

I would have to iterate through all of menu-item-1, menu-item-2 etc to remove them? Could I do something like this instead:

Cache::forget('menu-item-*');

And that would wipe out all of menu-item-* cache?

03 Mar
9 months ago

nikocraft left a reply on Precedence Of App.php Service Providers Vs Autoloaded Service Providers

true! I just upgraded to 5.5 and then to 5.6 and found out about dont-discover, however this seemed to work

    Igaster\LaravelTheme\themeServiceProvider::class,
    App\Providers\MyServiceProvider::class,

so I did not have to disable autodiscover for LaravelTheme package...

02 Mar
9 months ago

nikocraft started a new conversation Precedence Of App.php Service Providers Vs Autoloaded Service Providers

Hi

I am upgrading my app from 5.4 to 5.5 in 5.5 we have autoloaded SPs and since I am using a package that has to have a preceedance over my own SP which needs to load after this package and add some stuff to it.

I wonder how does Larave 5.5 handle preceedance with autoloaded SPs vs SPs in app.php

for example in 5.4 app.php I have this

    Igaster\LaravelTheme\themeServiceProvider::class,
    App\Providers\MyThemesServiceProvider::class,

now that I update to 5.5 Igaster/laravel-theme is autodiscovered so I do not need to add it to app.php

If I remove: Igaster\LaravelTheme\themeServiceProvider::class from app.php in 5.5

will I run into any problems with this line in app.php

App\Providers\MyThemesServiceProvider::class

and MyThemesServiceProvider not being able to find Igaster\LaravelTheme\themeServiceProvider

Greatfull for any insights from the community!

01 Mar
9 months ago

nikocraft started a new conversation I Run Composer Update On 5.5 After Adding Some Packages In Composer.json Got Problem With That...

I run composer update and got this output:

Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for tightenco/ziggy ^0.6.2 -> satisfiable by tightenco/ziggy[v0.6.2].
    - Conclusion: remove laravel/framework v5.5.36
    - Conclusion: don't install laravel/framework v5.5.36
    - Conclusion: don't install laravel/framework v5.5.35
    - Conclusion: don't install laravel/framework v5.5.34
    - Conclusion: don't install laravel/framework v5.5.33
    - Conclusion: don't install laravel/framework v5.5.32
    - Conclusion: don't install laravel/framework v5.5.31
    - Conclusion: don't install laravel/framework v5.5.30
    - Conclusion: don't install laravel/framework v5.5.29
    - Conclusion: don't install laravel/framework v5.5.28
    - Conclusion: don't install laravel/framework v5.5.27
    - Conclusion: don't install laravel/framework v5.5.26
    - Conclusion: don't install laravel/framework v5.5.25
    - Conclusion: don't install laravel/framework v5.5.24
    - Conclusion: don't install laravel/framework v5.5.23
    - Conclusion: don't install laravel/framework v5.5.22
    - Conclusion: don't install laravel/framework v5.5.21
    - Conclusion: don't install laravel/framework v5.5.20
    - Conclusion: don't install laravel/framework v5.5.19
    - Conclusion: don't install laravel/framework v5.5.18
    - Conclusion: don't install laravel/framework v5.5.17
    - Conclusion: don't install laravel/framework v5.5.16
    - Conclusion: don't install laravel/framework v5.5.15
    - Conclusion: don't install laravel/framework v5.5.14
    - Conclusion: don't install laravel/framework v5.5.13
    - Conclusion: don't install laravel/framework v5.5.12
    - Conclusion: don't install laravel/framework v5.5.11
    - Conclusion: don't install laravel/framework v5.5.10
    - Conclusion: don't install laravel/framework v5.5.9
    - Conclusion: don't install laravel/framework v5.5.8
    - Conclusion: don't install laravel/framework v5.5.7
    - Conclusion: don't install laravel/framework v5.5.6
    - Conclusion: don't install laravel/framework v5.5.5
    - Conclusion: don't install laravel/framework v5.5.4
    - Conclusion: don't install laravel/framework v5.5.3
    - Installation request for graham-campbell/markdown ^7.1 -> satisfiable by graham-campbell/markdown[v7.1.0].
    - Conclusion: don't install laravel/framework v5.5.2
   - graham-campbell/markdown v7.1.0 requires illuminate/view 5.1.*|5.2.*|5.3.*|5.4.* -> satisfiable by illuminate/view[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
    - don't install illuminate/view v5.1.1|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.13|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.16|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.2|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.20|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.22|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.25|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.28|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.30|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.31|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.41|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.6|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.1.8|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.0|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.19|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.21|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.24|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.25|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.26|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.27|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.28|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.31|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.32|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.37|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.43|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.45|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.6|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.2.7|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.3.0|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.3.16|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.3.23|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.3.4|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.0|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.13|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.17|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.19|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.27|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.36|don't install laravel/framework v5.5.0
    - don't install illuminate/view v5.4.9|don't install laravel/framework v5.5.0
    - tightenco/ziggy v0.6.2 requires laravel/framework ^5.4.29 -> satisfiable by laravel/framework[v5.5.36, v5.5.0, v5.5.1, v5.5.10, v5.5.11, v5.5.12, v5.5.13, v5.5.14, v5.5.15, v5.5.16, v5.5.17, v5.5.18, v5.5.19, v5.5.2, v5.5.20, v5.5.21, v5.5.22, v5.5.23, v5.5.24, v5.5.25, v5.5.26, v5.5.27, v5.5.28, v5.5.29, v5.5.3, v5.5.30, v5.5.31, v5.5.32, v5.5.33, v5.5.34, v5.5.35, v5.5.4, v5.5.5, v5.5.6, v5.5.7, v5.5.8, v5.5.9].
    - Conclusion: don't install laravel/framework v5.5.1


Does anyone have any idea what went wrong here? my require looks like this:

    "require": {
        "php": ">=7.0.0",
        "fideloper/proxy": "~3.3",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "barryvdh/laravel-debugbar": "^2.4",
        "caffeinated/modules": "^4.0",
        "camroncade/timezone": "^0.1.0",
        "doctrine/dbal": "^2.5",
        "graham-campbell/markdown": "^7.1",
        "igaster/laravel-theme": "dev-master",
        "intervention/image": "^2.4",
        "mews/purifier": "^2.0",
        "santigarcor/laratrust": "3.2.*",
        "tightenco/ziggy": "^0.6.2"
    },

nikocraft left a reply on Do I Need To Include Doctrine/dbal In Composer For Laravel 5.5 And Above?

No I do not have such migrations yet, since project is not yet released and I can refactor it as I see fit, no need to create migrations for modifications of columns right now. Thanks for really quick response, much obliged! :)

nikocraft left a reply on Do I Need To Include Doctrine/dbal In Composer For Laravel 5.5 And Above?

Hi @sutherland

should I add it again? Lets say I need to modify existing columns using a migration, then I need this package or is it autoincluded in 5.5 and above?

nikocraft started a new conversation Do I Need To Include Doctrine/dbal In Composer For Laravel 5.5 And Above?

I am looking to upgrade my app from laravel 5.4 to laravel 5.5, I just intalled new laravel app based on 5.5 and opened composer and comparing to my existing app composer I just found this

    "require": {
        "php": ">=7.0.0",
        "fideloper/proxy": "~3.3",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0"
    },

while in my 5.4 app I found that I had inside require among other things:

      "doctrine/dbal": "^2.5",

Do I need to include this manually in fresh laravel 5.5 app or is it not required? I'm not sure why I have it in 5.4, maybe it was required for that version?

nikocraft started a new conversation Blade HasSection, What Is It Really?

Hi

Could someone explain to me what hasSection is and how it works?

I have read this: https://laravel.com/docs/5.6/blade

You may check if a section has content using the @hasSection directive:

But I do not understand, what does hasSection actually do to check if there is some content in section or not? For example:

@hasSection('navigation')
    <div class="pull-right">
        @yield('navigation')
    </div>

    <div class="clearfix"></div>
@endif

What happens here? Where does 'navigation' inside hasSection come from? Is it a model from db, if not then what is it and where it does get initiated?

Thanks in advance...