psychosocial227

psychosocial227

Member Since 1 Year Ago

Experience Points 1,330
Experience Level 1

3,670 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 2
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.

12 Sep
3 days ago

psychosocial227 left a reply on Using Multiple CSS File On Vue.

Ooops thanks. What I actually want is to dynamically use the admininterface.css file while on the admin panel and userinterface.css for the frontend.

11 Sep
4 days ago

psychosocial227 started a new conversation Using Multiple CSS File On Vue.

//This my main.js file

import Vue from 'vue';

import VueRouter from 'vue-router';


Vue.use(VueRouter);


// Router-view to mount

import Purplex from './components/Purplex.vue';


//routes

import routes from './routes';


const router = new VueRouter({

mode: 'history',

IinkActiveClass: 'is-active',

routes

});


const app = new Vue({

el: '#app',

components:{ Purplex },

router,

});


//This my router-view component

<template>

<div>


<navbar> </navbar>


<router-view> </router-view>


<foot> </foot>


</div>

</template>



<script>


import Navbar from '././views/userInterface/Navbar.vue'

import Foot from './views/userInterface/Footer.vue';


export default {


components: {

Navbar,

Foot

},


}

</script>


// this my app outlet file



<!doctype html>

<html lang="{{ app()->getLocale() }}">

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1">


<!-- CSRF Token -->

<meta name="csrf-token" content="{{ csrf_token() }}">


<!-- Styles -->

//user interface only
<link href=" {{ asset('css//user_interface/fontawesome.css') }}" rel="stylesheet">

//user interface only
<link href="{{ asset('css/user_interface/bulma.css') }}" rel="stylesheet">

//admin interface only

<link href=" {{ asset('css//admin_interface/fontawesome.css') }}" rel="stylesheet">


//admin interface only

<link href="{{ asset('css/admin_interface/bulma.css') }}" rel="stylesheet">


<!-- Animate.css to handle animation -->
<link href="{{ asset('css/animate.css') }}" rel="stylesheet">


</head>


<body>


<Purplex id="app"> </Purplex>


</body>


<script src="{{ mix('js/app.js') }}"></script>

<script src="{{ mix('js/purplex.js') }}"></script>


</html>
15 Jul
2 months ago

psychosocial227 left a reply on Rendering Blade Syntax In A Vue Component

Thanks...This exactly what i wanted...

14 Jul
2 months ago

psychosocial227 started a new conversation Rendering Blade Syntax In A Vue Component

Am asking to know how can one render a blade syntax in a view component example i will like to render this

{{ config('app.name') }} © {{ date("Y")}}

piece of code in a vue component.. If there is any article or other type of material to look at i will be more gratefull Thanks..

11 Jul
2 months ago
10 Jul
2 months ago

psychosocial227 started a new conversation Converting My Laravel Head Blade File To A Vue Component

How can i use this in a vue component. Trying it this way output an error. Am thinking of slot

<template>
    <div>
        <!doctype html>
<html lang="{{ app()->getLocale() }}">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- CSRF Token -->
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title> @yield('title') </title>

        <!-- Styles -->
        <link href=" {{ asset('css/fontawesome.css') }}" rel="stylesheet">
        <link href="{{ asset('css/bulma.css') }}" rel="stylesheet">
        <link href="{{ asset('css/purplex.css') }}" rel="stylesheet">
        

        <!-- Animate.css to handle animation -->
        <link href="{{ asset('css/animate.css') }}" rel="stylesheet">

</head>
    </div>
</template> 
27 Jun
2 months ago

psychosocial227 left a reply on Laravel Mix Multiple File

Thanks solve it though.

psychosocial227 started a new conversation Laravel Mix Multiple File

I want to keep the app.scss to keep pointing to the app.css my problem is how do i add another path. Example I created a blog.scss file and i want it to point to blog.css . A simple sample will make sense to me thanks... If i didn't put my question right you can aid me rephrase it..

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

mix.sass('resources/sass/app.scss', 'public/css');``

05 May
4 months ago

psychosocial227 started a new conversation PHP Standard Coding Tool

Hi will like to know if laravel have a PHP standard tool already installed and if not which is the best tool and mostly used by industry.

26 Apr
4 months ago

psychosocial227 left a reply on Eloquent Collection

Thanks desc is what i want.

psychosocial227 left a reply on Eloquent Collection

@SERGIU17 - Won't desc sort by the highest number in the table. I want the highest integer in the view_count column which might not be the table largest number. If am wrong please explain to me thanks.

psychosocial227 left a reply on Eloquent Collection

@SERGIU17 - Thanks i thought as much. Dumb me.

psychosocial227 started a new conversation Eloquent Collection

I have a posts table with a column name view_count. This column take count on how many time a paticular row in my posts table is view. My issue now is how to sort the column by most viewed thanks. A sample will be okay thanks. This laravel related....

18 Apr
4 months ago

psychosocial227 started a new conversation Best Practice To Handle Integrity Violation Error For Unique Field

More closely laravel related. Hi all i have a slug field that set to unique it inherit the title input and use the php substr function to shorten the slug and str_replace to add hyphen to space to make the uri appear apealing and readable to users. I run into an integrity violation error whick okay but how i handle the problem isn't satisfied by me as i was unable to wrap my brain on how to handle the situation as directed by the laravel documentation. This how i get it fixed .

 $slug_errorbag = Post::all();  // Get item from database
       foreach ($slug_errorbag as $slug_errorbag) {  //iterate the item
           if ($post->slug  ===  $slug_errorbag->slug ) { // Compare if it match any slug item
//If true tell the user to suffix his or her title
           }
       } 
// continue and save to DB

If this database should grow in future i see it as a problem. I might be wrong will love to hear your thought......

15 Apr
5 months ago

psychosocial227 left a reply on Laravel

@JLRDW - I finally sort it out. Telling me what i ought to know before jumping into laravel is of no impotant if you want to assist. Thanks

psychosocial227 left a reply on Laravel

@SNAPEY - Can you give me a sample on how to handle multiple select.

psychosocial227 left a reply on Laravel

@SNAPEY - get to see your old answer related to this same issue and i was able to wrap my brain around it . Thanks yhis how the final code look

<select class="custom-select form-control" name="category_id" required>
  @foreach($category as $categories)
  <option value="{{ $categories->id }}" {{old('category_id', $post->category_id) == $categories->id ? 'selected' : ''}} >{{$categories->name }} <span class="badge badge-success"  data-placement="left" title="No. of post"> {{$categories->posts->count()}} </span> </option> @endforeach
</select>

psychosocial227 left a reply on Laravel

@TYKUS - Like can i use the $model->category_id without requiring laravel-collective or form helper

psychosocial227 left a reply on Laravel

@SNAPEY - Please i will need a sample on how to pass the previous choice to the view. Thanks

psychosocial227 left a reply on Laravel

@SNAPEY - Can i use model binding with native or bootsratp form. If yes i will be needing a sample on how to implement it.

psychosocial227 left a reply on Laravel

@TYKUS - Can i use model binding with native or bootsratp form. If yes i will be needing a sample on how to implement it.

psychosocial227 started a new conversation Laravel

Hi all. I have a select field in my form for users to select tags and category I would like the state of the previous selected tags/category to be highlighted why editing the form. Can this be done just using the natural laravel flow or implementing some few lines of vanilla js(Ajax). Thanks .Answers should be strongly laravel related.

06 Dec
9 months ago

psychosocial227 started a new conversation Can't Target A Single Post Using Laravel Notification

Hi artisans am using laravel notification to notify my subscribe users of new post posted on a blog but i run into an issue as i cannot target the particular post that is posted or approved by admin if the user click the action button. From the code below if a user click it redirect them to another page on the site. This pastebin https://paste.laravel.io/898a2be5-716e-45bc-9fd6-961f85a6c66c

This my to mail method

public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject('New Post Available')
            ->greeting('Hello, Subscriber')
            ->line('There is a new post. We hope you will like it.')
            ->line('Post Title : '.$this->post->title)
            ->action('View Post', url('post/{{$post->slug}}'))
            ->line('Thank you for using our application!');
    }

Thanks for your guidance.

05 Dec
9 months ago

psychosocial227 left a reply on Laravel Image Broken After App Was Running Okay

@LOSTDREAMER_NL - I don't know honestly and i don't know how an app that was working fine just stop.

psychosocial227 left a reply on Laravel Image Broken After App Was Running Okay

@LOSTDREAMER_NL - The image is in the storage folder

Yes the image attribute is set

Image URl can be access

Even old image that work properly are affected

psychosocial227 started a new conversation Laravel Image Broken After App Was Running Okay

Hi my app was running preety well until today i realise image link is broken why working with notification and hoping to deploy anytime soon and a nighmare emerge. Here is how i set up my image algorithm. Am using intervention image package. As i said everything was working perfectly fine as first and i will be grateful if anyone can help with this nightmare.

This my store method

public function store(Request $request)
    {

        $this->validate($request,[
            'title' => 'required',
            'image' => 'required',
            'categories' => 'required',
            'body' => 'required',
        ]);

        $image = $request->file('image');
        $slug = str_slug($request->title);

        if(isset($image))
        {

        #  make unipue name for image
            $currentDate = Carbon::now()->toDateString();
            $imageName  = $slug.'-'.$currentDate.'-'.uniqid().'.'.$image->getClientOriginalExtension();

            if(!Storage::disk('public')->exists('post'))
            {

                Storage::disk('public')->makeDirectory('post');
            }

            $postImage = Image::make($image)->resize(1600,1066)->stream();
            Storage::disk('public')->put('post/'.$imageName,$postImage);

        } else {

            $imageName = "purple.png";
        }

        $post = new Post();
        $post->user_id = Auth::id();
        $post->title = $request->title;
        $post->slug = $slug;
        $post->image = $imageName;
        $post->body = $request->body;
             $post->save();
      
        return redirect()->route('admin.post.index');
    }

This my view and this how the image is called

{{ asset('Storage/post/'.$post->image) }}

php artisan storage:link have been utilized

this how my filesystem is set up

'default' => env('FILESYSTEM_DRIVER', 'local'),
 'disks' => [
        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),

        ],
        'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

If am missing anything please let me know thanks in advance.

28 Nov
9 months ago

psychosocial227 left a reply on Content Seclusion From Some Link

@LOSTDREAMER_NL - Thanks man the issue was from my root.

psychosocial227 left a reply on Content Seclusion From Some Link

@LOSTDREAMER_NL - Still the opposite i wish i can solve my problem is eating me up and my method exhibit same character and it was cause of the issue i ask for help.

psychosocial227 left a reply on Content Seclusion From Some Link

@REALRANDYALLEN - Was thinking content here will be return if on a paticular route and content return when in other root.

psychosocial227 left a reply on Content Seclusion From Some Link

@LOSTDREAMER_NL - It work the opposite instead and return this one does not on my porfolio route.

psychosocial227 started a new conversation Content Seclusion From Some Link

Hi all i will be needing an assistance. I have a navbar that all link on my app use but i will like to seclude a search form from some of the link in the app but am having difficulty doing that. This what i have tried on my nabvar so far example

Tried using route but no success @if( (route('portfolio') &&(route('portfolio.details) content here @else content @endif

then i tried targeting the URI

@if( Request::is('/portfolio') &&(route('portfolio/details) content here @else content @endif NOne seems to working. PHP and Laravel

05 Nov
10 months ago

psychosocial227 left a reply on Conditional Logic

I will like to avoid such repetition.

psychosocial227 started a new conversation Conditional Logic

This destroy method work perfectly well using laravel framework to delete a single file.

  • public function destroy(portfolio $portfolio) { if(Storage::disk('public')->exists('portfolio/'.$portfolio->cover) { Storage::disk('public')->delete('portfolio/'.$portfolio->cover); } $portfolio->delete(); Session::flash('status', 'Portfolio deleted succesfully'); return redirect()->back(); } }

But i have 4 file that i will like to delete how do one pass such logic and this what i have tried.

*public function destroy(portfolio $portfolio)
    {

        if(Storage::disk('public')->exists('portfolio/'.$portfolio->cover && Storage::disk('public')->exists('portfolio/'.$portfolio->detail_1) &&
        (Storage::disk('public')->exists('portfolio/'.$portfolio->detail_2 && Storage::disk('public')->exists('portfolio/'.$portfolio->detail_3) ) {
        
            Storage::disk('public')->delete('portfolio/'.$portfolio->cover);
            Storage::disk('public')->delete('portfolio/'.$portfolio->detail_1);
            Storage::disk('public')->delete('portfolio/'.$portfolio->detail_2);
            Storage::disk('public')->delete('portfolio/'.$portfolio->detail_3);
        }
        $portfolio->delete();
        Session::flash('status', 'Portfolio deleted succesfully');
        return redirect()->back();
    }
}*
01 Nov
10 months ago

psychosocial227 left a reply on Image Link Broken

Thanks pal but i solve it by adding the storage before profile.

psychosocial227 left a reply on Image Link Broken

Image still broken can you look at my config/filesystem setting to see if am making any mistake in my configuration.

psychosocial227 started a new conversation Image Link Broken

I will need your help as my image url appear to be broken in my browser which am sure i did everything correctly or so i think. I want to add an image to my update profile user acc below is how my code circle is structure. This my user table schema

 *public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');

            $table->integer('role_id')->default(2);
            $table->string('name');
            $table->string('username')->unique();
            $table->string('email')->unique();
            $table->string('password');
            $table->string('image')->default('default.png');
            $table->text('about')->nullable();
            $table->rememberToken();
            
            $table->timestamps();
        });
    }*

, this my setting controller that have the updateProfile method

*public function updateProfile(Request $request)
    {
        $this->validate($request,[
            'name' => 'required',
            'email' => 'required|email',
            'image' => 'required|image',
        ]);
        $image = $request->file('image');
        $slug = str_slug($request->name);
        $user = User::findOrFail(Auth::id());
        if (isset($image))
        {
            $currentDate = Carbon::now()->toDateString();
            $imageName = $slug.'-'.$currentDate.'-'.uniqid().'.'.$image->getClientOriginalExtension();
            if (!Storage::disk('public')->exists('profile'))
            {
             Storage::disk('public')->makeDirectory('profile');
            }
//            Delete old image form profile folder
            if (Storage::disk('public')->exists('profile/'.$user->image))
            {
                Storage::disk('public')->delete('profile/'.$user->image);
            }
            $profile = Image::make($image)->resize(500,500)->stream();
            Storage::disk('public')->put('profile/'.$imageName,$profile);
        } else {
            $imageName = $user->image;
        }
        $user->name = $request->name;
        $user->email = $request->email;
        $user->image = $imageName;
        $user->about = $request->about;
        $user->save();
        Toastr::success('Profile Successfully Updated :)','Success');
        return redirect()->back();*

, i have use the php artisan storage:link, here is my view linking to my public/profile directory

 *<a class="avatar" href="{{ route('author.profile',$post->user->username) }}"><img src="{{ Storage::disk('public')->url('profile/'.$post->user->image) }}" alt="Profile Image"></a>*

and here is my config/filesystem file settings

14 Jul
1 year ago

psychosocial227 started a new conversation URLs For Controller Actions With Parameters With Form Submit

Post Title Slug Post Description Submit

Please someone should instruct me how to submit this form using URLs For Controller Actions. Thanks in advance.