monstajamss

monstajamss

Member Since 4 Months Ago

Experience Points
3,510
Total
Experience

1,490 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
5
Lessons
Completed
Best Reply Awards
0
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 1
3,510 XP
Jul
27
1 week ago
Activity icon

Replied to Laravel Envoyer Problem

@michaloravec do you have any idea?

Jul
25
1 week ago
Activity icon

Replied to Laravel Envoyer Problem

Does anyone have any answer or response?

Jul
23
1 week ago
Activity icon

Started a new Conversation Laravel Envoyer Problem

I want to ask if it is possible to deploy laravel project using DigitalOcean and Laravel Envoyer instead of Laravel Forge and Laravel Envoyer.

If it is possible, how please??

Jul
19
2 weeks ago
Activity icon

Replied to Trying To Display Single Post Returns 404 Not Found

@michaloravec @michaloravec please i want the Page Title to be like this New Topic - Music, Sitename

so i did this

@section('title', $category->name .' - ')

and it is just giving me Music - Sitename

note: (Music) is the category name

Activity icon

Replied to Trying To Display Single Post Returns 404 Not Found

@mabdullahsari what about doing it like this

$post = Post::where('slug', '=', $slug)->firstorFail();
Activity icon

Started a new Conversation Trying To Display Single Post Returns 404 Not Found

I am trying to display single post details in my project

Route

Route::get('/post/{slug}', '[email protected]')->name('post.show');

Controller

public function show($slug)
    {
        $post = Post::findorFail($slug);
        return view('post.single', compact('post'));
    }

view link that leads to the single post gape

<h6 class="card-title"><a href="{{ route('post.show',$post->slug) }}"> {{ $post->subject }}</a>

When user click the link localhost:8000/post/example-post it gives Page Not Found

what am i doing wrong?

Activity icon

Replied to Redirect To Another Page After Making A Post

@marianomoreyra

This is my route

Route::get('/{category}', '[email protected]');
Jul
18
2 weeks ago
Activity icon

Replied to Redirect To Another Page After Making A Post

@jlrdw if i should do return redirect('/other/place'); it will not be dynamic

Activity icon

Started a new Conversation Redirect To Another Page After Making A Post

I have a category e.g music category.

How can i redirect or go to the category page when i am done making a post

i have this in my controller

 public function store(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'subject' => 'required|min:20',
            'body' => 'required|min:20'
        ]);

        if ($validator->fails()) {
            return redirect()
                        ->back()
                        ->withErrors($validator)
                        ->withInput();
        }

        $post=auth()->user()->post()->create($request->all());

        $post->categories()->attach($request->categories);

        return redirect('/');
    }

The redirect('/) goes to the home page but i want to redirect it to the category page instead that i made the post under

My category link is like this localhost:8000/music

Activity icon

Replied to Trying To Get Property 'id' Of Non-object

@michaloravec please i want the Page Title to be like this New Topic - Music, Sitename

so i did this

@section('title', $category->name .' - ')

and it is just giving me Music - Sitename

note: (Music) is the category name

Activity icon

Replied to Trying To Get Property 'id' Of Non-object

@michaloravec it has worked

I am trying to get the Category Name for the Page title

what am i doing wrong

@section('title', {{$category->name}} . ' - ')

i got this syntax error, unexpected '<', expecting ')'

Activity icon

Replied to Trying To Get Property 'id' Of Non-object

@michaloravec but it is not still working still getting that error

Activity icon

Replied to Trying To Get Property 'id' Of Non-object

@michaloravec got this

array:5 [▼
  "id" => 1
  "name" => "Politics"
  "slug" => "politics"
  "created_at" => "2020-07-18T20:54:13.000000Z"
  "updated_at" => "2020-07-18T20:54:13.000000Z"
]
Activity icon

Replied to Trying To Get Property 'id' Of Non-object

@jlrdw i am not trying to loop

I am trying to do this <a href="/create/{{category->id}}">Create Topic</a>

Activity icon

Replied to Trying To Get Property 'id' Of Non-object

@michaloravec it does not work stil giving the error

Activity icon

Started a new Conversation Trying To Get Property 'id' Of Non-object

I am trying to get the id of a category

Controller

public function index(Request $request, $category=null)
    {  
        $category=Category::where('slug','=',$category)->first();
        $posts = Post::latest()->paginate(15);
        
        return view('category.news',compact('category','posts'));
    }

Route

Route::get('/{category}', '[email protected]');

View

{{$category->id}} 

gives me this error Trying to get property 'id' of non-object

Jul
11
3 weeks ago
Activity icon

Replied to Laravel Email Verification Process Throw Error

@sergiu17 which route would i change

Auth::routes(['verify' => true]);

Jul
10
3 weeks ago
Activity icon

Started a new Conversation Laravel Email Verification Process Throw Error

I am trying to make users verify email on my platform but anytime they login and they click the verification link like example.com/email/resend they get this error

ethodNotAllowedHttpException
HTTP 405 Method Not Allowed
The GET method is not supported for this route. Supported methods: POST.
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);$response = $kernel->handle(    $request = Illuminate\Http\Request::capture());$response->send();$kernel->terminate($request, $response);
MethodNotAllowedHttpException
in /app/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php (line 117)
in /app/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php -> methodNotAllowed (line 103)
in /app/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php -> getRouteForMethods (line 40)
Jun
20
1 month ago
Activity icon

Replied to Implode(): Passing Glue String After Array Is Deprecated

Thanks everyone for answering, i really appreciate it. I was able to solve the problem by upgrading my Laravel project from Version 5 to Version 7. After doing that the website worked and i did not get that problem anymore.

Once again thanks @snapey @jeffreyway @michaloravec @preskhaled @jlrdw

Activity icon

Replied to Implode(): Passing Glue String After Array Is Deprecated

@snapey i do not know where i am getting the error from

Activity icon

Started a new Conversation Implode(): Passing Glue String After Array Is Deprecated

I am trying to make a post and i got this error ErrorException (E_DEPRECATED) implode(): Passing glue string after array is deprecated. Swap the parameters

C:\MAMP\htdocs\naijaswiftforum\vendor\cviebrock\eloquent-sluggable\src\Services\SlugService.php
     * @param mixed $from
     *
     * @return string
     */
    protected function getSlugSource($from): string
    {
        if (is_null($from)) {
            return $this->model->__toString();
        }
 
        $sourceStrings = array_map(function($key) {
            $value = data_get($this->model, $key);
            if (is_bool($value)) {
                $value = (int) $value;
            }
 
            return $value;
        }, (array) $from);
 
        return implode($sourceStrings, ' ');
    }
 
    /**
     * Generate a slug from the given source string.
     *
     * @param string $source
     * @param array $config
     * @param string $attribute
     *
     * @return string
     * @throws \UnexpectedValueException
     */
    protected function generateSlug(string $source, array $config, string $attribute): string
    {
        $separator = $config['separator'];

Can someone help?

Jun
14
1 month ago
Activity icon

Replied to Image Is Saving As /tmp In Laravel

I have solved it

  1. I did not add aws details to .env on nginx server
  2. i did not add another package details .env on nginx server
Activity icon

Replied to Image Is Saving As /tmp In Laravel

@jlrdw it says this

2020-06-14 21:00:32] production.ERROR: fopen(/var/www/laravel/public/image/uploads/1.png): failed to open stream: Permission denied {"userId":1,"exception":"[object] (ErrorException(code: 0): fopen(/var/www/laravel/public/image/uploads/1.png): failed to open stream: Permission denied at /var/www/laravel/vendor/league/flysystem/src/Adapter/Local.php:157)

Then

[2020-06-14 21:13:07] production.ERROR: URI must be a string or UriInterface (View: /var/www/laravel/resources/views/pages/welcome.blade.php) {"exception":"[object] (ErrorException(code: 0): URI must be a string or UriInterface (View: /var/www/laravel/resources/views/pages/welcome.blade.php) at /var/www/laravel/vendor/guzzlehttp/psr7/src/functions.php:62) 
Activity icon

Started a new Conversation Image Is Saving As /tmp In Laravel

I have configured my laravel server and my laravel root is /var/www/laravel but anytime i upload an image it shows as

/tmp/phptxLvZD

inside the database

how can i resolve this?

Activity icon

Replied to Image Not Saving In Laravel Nginx Ubuntu Server

Now i am getting this error

[2020-06-14 21:13:07] production.ERROR: URI must be a string or UriInterface (View: /var/www/laravel/resources/views/pages/welcome.blade.php) {"exception":"[object] (ErrorException(code: 0): URI must be a string or UriInterface (View: /var/www/laravel/resources/views/pages/welcome.blade.php) at /var/www/laravel/vendor/guzzlehttp/psr7/src/functions.php:62) ```
Activity icon

Replied to Image Not Saving In Laravel Nginx Ubuntu Server

@t0berius it works when i edit the post the image saves but does not save properly on new posts

Activity icon

Started a new Conversation Image Not Saving In Laravel Nginx Ubuntu Server

I just deployed my laravel project on Nginx Ubuntu Server but anytime i tried to upload image i get this error

2020-06-14 21:00:32] production.ERROR: fopen(/var/www/laravel/public/image/uploads/1.png): failed to open stream: Permission denied {"userId":1,"exception":"[object] (ErrorException(code: 0): fopen(/var/www/laravel/public/image/uploads/1.png): failed to open stream: Permission denied at /var/www/laravel/vendor/league/flysystem/src/Adapter/Local.php:157)

and also in my database i get this /tmp/phpuFp8xC

What am i doing wrong?

Activity icon

Replied to Trying To Set Http To Https Redirect On Nginx

@bobbybouwmann i have installed phpmyadmin also but the page is not loading, it is just showing a blank white page.

How can i resolve this?

Activity icon

Started a new Conversation Trying To Set Http To Https Redirect On Nginx

I have my server set up already and project deployed on Vultr VPS and i am trying to set redirection for my domain but i keep getting this error This page isn’t working henryestate.xyz redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS

I have tried to edit what my etc/nginx/sites-enabled/default

I have the below code:

server {
listen 80 default_server;
listen [::]:80 default_server;

# SSL configuration
#
listen 443 ssl;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;
root /var/www/laravel/public;

# Add index.php to the list if you are using PHP
index index.php index.html index.htm;

server_name henryestate.xyz www.henryestate.xyz;

return 301 https://henryestate.xyz$request_uri;


ssl_certificate /etc/nginx/ssl/cert_chain.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
}

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}

How can i sort this https redirection to allow the website load with https for both www and non www

Jun
12
1 month ago
Activity icon

Replied to Trying To Get Details Of Posts In Single Page

@snapey the property id belongs to the category

the url looks like this localhost:8000/categoryname/example-post

<a href="{{ route('posts.show',['category'=>strtolower($properties->apartmenttype()->first()->name), 'property'=>$properties->slug]) }}">{{$properties->title}}</a>
Activity icon

Replied to Trying To Get Details Of Posts In Single Page

I did this now

Route::get('/{category}/{property}','[email protected]')->name('posts.show');
public function show(Property $property, Category $category)
    {
        $title = "Single Post";
        return view('properties.show', compact('title','property','category'));
    }
<h4>{{$property->title}}</h4>

Now it is showing Not Found

Activity icon

Replied to Trying To Get Details Of Posts In Single Page

@tykus there is title in the Property Model.

Activity icon

Replied to Share Laravel Project With Ngrok In Laragon

Ngrok generates some url at the back of the url add your laravel folder name then public like ngrokurl/foldername/public

It should work

Activity icon

Started a new Conversation Trying To Get Details Of Posts In Single Page

i am trying to get the details of a post content in a single page and i have this in my web.php

Route::get('/{category}/{post}','[email protected]')->name('posts.show');

and i have this in my controller

public function show(Property $property)
    {
        $title = "Single Post";
        return view('properties.show', compact('title','property'));
    }

also in my blade i have this <h4>{{$property->title}}</h4>

But it is showing empty tag without showing the title

what am i doing wrong?

Activity icon

Replied to Laravel Post Slug(Url)

@tykus it is showing like this localhost:8000/Apartment/example-post but how can i change the A in Apartment to small letter a like this localhost:8000/apartment/example-post

Activity icon

Replied to Laravel Post Slug(Url)

I was able to solve it

<a href="{{ route('posts.show',['category'=>$properties->apartmenttype()->first()->name, 'post'=>$properties->slug]) }}">{{$properties->title}}</a>
Activity icon

Replied to Laravel Post Slug(Url)

@tykus i did this <a href="{{ route('posts.show',['category'=>'$properties->apartmenttype()->first()->name', 'post'=>$properties->slug]) }}"> but the url is showing like this http://localhost:8000/%24properties-%3Eapartmenttype%28%29-%3Efirst%28%29-%3Ename/smart-5-bedroom-fully-detached-with-bq

What am i doing wrong?

Activity icon

Replied to Laravel Post Slug(Url)

@tykus after doing that i got this error Missing required parameters for [Route: posts.show] [URI: {category}/{post}]. (View: C:\MAMP\htdocs\laravel-real-estate\resources\views\pages\welcome.blade.php)

Activity icon

Started a new Conversation Laravel Post Slug(Url)

I am trying to make my website slug/url be like this localhost:8000/apartment/example-post-cat-come instead of localhost:8000/example-post-cat-come

I have categories like

  1. Apartment
  2. Flat

i want to add the post category before the slug in the url

currently i am doing this

Route::get('/{post}','[email protected]')->name('posts.show');

How can i make the category show before url?

Jun
10
1 month ago
Activity icon

Awarded Best Reply on Image Not Storing/saving

I was able to solve this, thanks for not helping me though

Controller

private function storeImage($post)
    {
        if (request()->has('featured_image')){

            $original = request()->file('featured_image')->getClientOriginalName();

            $post->update([
                'featured_image' => request()->file('featured_image')->storeAs('uploads', $original),
            ]);

            $image = Image::make(public_path('image/'. $post->featured_image))->resize(362, 240);
            $image->save();
        }
    }
'local' => [
            'driver' => 'local',
            'root' => public_path('image/'),
        ],
Activity icon

Replied to Image Not Storing/saving

I was able to solve this, thanks for not helping me though

Controller

private function storeImage($post)
    {
        if (request()->has('featured_image')){

            $original = request()->file('featured_image')->getClientOriginalName();

            $post->update([
                'featured_image' => request()->file('featured_image')->storeAs('uploads', $original),
            ]);

            $image = Image::make(public_path('image/'. $post->featured_image))->resize(362, 240);
            $image->save();
        }
    }
'local' => [
            'driver' => 'local',
            'root' => public_path('image/'),
        ],
Activity icon

Replied to Image Not Storing/saving

Now i am getting this error fopen(C:\MAMP\htdocs\laravel-real-estate\public\image\uploads): failed to open stream: Permission denied

After doing this

private function storeImage($post)
    {
        if (request()->hasFile('featured_image')){

            $original = request()->file('featured_image')->getClientOriginalName();

            $post->update([
                'featured_image' => request()->file('featured_image')->storeAs('uploads', $original),
            ]);

            $image = Image::make(request()->file('featured_image'));
            Storage::disk('local')->put('uploads', $image->stream(), 'public');
            $image = Storage::disk('local')->temporaryUrl("uploads", Carbon::now()->addMinutes(5));
            
        }
    }
'local' => [
            'driver' => 'local',
            'root' => public_path('image/'),
        ],
Activity icon

Started a new Conversation Image Not Storing/saving

I am trying to save image in my public folder

private function storeImage($post)
    {
        if (request()->hasFile('featured_image')){

            $original = request()->file('featured_image')->getClientOriginalName();

            $post->update([
                'featured_image' => request()->file('featured_image')->storeAs('uploads', $original),
            ]);

            $image = Image::make(request()->file('featured_image'));
            Storage::disk('public')->put('uploads', $image->stream(), 'public');
            
        }
    }
'public' => [
            'driver' => 'local',
            'root' => public_path() . '/uploads',
            'url' => env('APP_URL').'/public',
            'visibility' => 'public',
        ],

But it is not storing, what am i doing wrong?

Jun
08
1 month ago
Activity icon

Started a new Conversation Saving Price Or Amount In Database

I am working on a laravel project that would allow user to enter price of goods currently i have price in my database table with type like this decimal(9,3) but i want to make the price come like this 10,000.00

how can i format it like that both in the database and in the blade?

Activity icon

Replied to Contents For Specific Users Not Displaying

i did this $property = Auth::user()->property()->latest()->paginate(15); and it worked

but i wanted to ask between this $property = Auth::user()->property()->latest()->paginate(15); and $property = Auth::user()->property()->get(); which is preferable and if $property = Auth::user()->property()->get(); is better how can i paginate it?

Activity icon

Replied to Contents For Specific Users Not Displaying

@michaloravec how does it work for authenticated user? i think that is the best way to do it but how does it work?

Activity icon

Replied to Contents For Specific Users Not Displaying

@michaloravec @deepu07 it is not displaying the posts, it is blank. I want to display all the posts made man a user.. Normally if i want to do it for blog i will use Route::get('/all-properties/{user}', 'Dashboard\[email protected]'); which means localhost:8000/all-properties/username is there no way i can display it without making the url like localhost:8000/all-properties/username but display it under localhost:8000/all-properties

Thanks

Jun
07
1 month ago
Activity icon

Started a new Conversation Contents For Specific Users Not Displaying

I am trying to display posts contents for each specific users but it is not showing i have this in my controller

public function index(User $user)
    {
        $title = 'All Properties';
        $property = Property::where('user_id',$user->id)->latest()->paginate(15);
        $apartmenttypes = Category::all();
        $location = Location::all();
        return view('dashboard.all-properties', compact('title','property'))->with('property', $property, 'apartmenttypes', $apartmenttypes, 'location', $location);
    }

Blade

<tbody>
			        	@foreach ($property as $properties)
			          <tr>
			            <td><a href="{{ route('posts.show',$properties->slug) }}" target="_blank">{{ $properties->title }}</a></td>
						<td>{{ $properties->apartmenttype()->first()->name }}</td>
						<td>{{ $properties->created_at->format('m/d/Y') }}</td>
			            <td>{{$properties->user->username}}</td>
			            <td>{{ $properties->location()->first()->city }}</td>

			            <td>
			            	<a href="/admin-editproperty/{{ $properties->id }}" class="btn btn-success">Edit</a>
			            </td>
			            <td>
			            	<form action="/adminpost-delete/{{ $properties->id }}" method="post">
			        			{{ csrf_field() }}
			        			{{ method_field('DELETE') }}
			            		<button type="submit" class="btn btn-danger">Bin</button>
			            	</form>
			            </td>
			          </tr>
			          @endforeach
			        </tbody>

web.php

Route::get('/all-properties', 'Dashboard\[email protected]');

I want the posts to display on this url localhost:8000/all-posts

How can i do this please?

Jun
05
1 month ago
Activity icon

Replied to Problem With User Permission

Currently i am manually adding the roles to model in the database using the spatie package, how can i do this from the registration form automatically?