inzmam

inzmam

Member Since 1 Year Ago

Experience Points 680
Experience Level 1

4,320 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 0
Lessons
Completed
Best Reply Awards 0
Best Reply
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.

17 Mar
1 year ago

inzmam left a reply on Unable To Upload Video File

thanks for your reply @Snapey . Issue is fixed now. When i use has() instead of hasFile() it finds the file, after that there was an issue of file size which i fixed it by modifying the correct php.ini file.

Thanks to all of you who have been with me for so long.

inzmam left a reply on Unable To Upload Video File

Keeping

 $video=$request->file('Upload_video');
 dd($video);

It shows me the file details but when keep the same code inside the if block it does not. Just wanted to know from you what are the possible reasons for @if section not being excuted.

inzmam left a reply on Unable To Upload Video File

Yeah same i have tried to check if at least it contains the name of the file, then it does not contain the name also because if section is not being executed.

I am surprised when i am uploading the images instead videos, it contains all the details of images but it does not contain the video details while uploading the same.

inzmam left a reply on Unable To Upload Video File

Yeah i have tried previous answers also, when i am keeping this code

 $vid->filename='inzmam';
 $vid->path='ul haq';

inside the if section to check if this string is printed, then also it does not print it. What i want to bring it to your notice is, my if section itself is not being executed at all. What could be possible reasons for this.

inzmam left a reply on Unable To Upload Video File

The video size is just 7MB, i have also configured the php.ini file to increase the max file size.

inzmam left a reply on Unable To Upload Video File

I am sorry, if it has caused confusion.

$vid->filename='inzmam';
$vid->path='ul haq';

was just written for debugging purpose. However, I have just noticed that my code execution does not enter inside the @if code block.

The actual data that i want to pass into the database table is

 $vid->filename=$filename;
             $vid->path=$path;

inzmam left a reply on Unable To Upload Video File

thanks for your reply! Yeah it does, meant anything of the uploaded video, but when i upload images, it shows all the info??

inzmam left a reply on Unable To Upload Video File

Someone please help me.......

inzmam left a reply on Unable To Upload Video File

dd($vid) does not contain anything, however when i upload images instead of video it has all the info.

does laravel support video upload or it needs different configuration. I think it needs some different config.

please help me in this case. I am stuck in this since a long time

16 Mar
1 year ago

inzmam left a reply on Unable To Upload Video File

$vid is an object of VideoStores model and move function is being used to store the video in video folder under public, do we have any other way out to upload video files and why can't it be done on the same way as i did it to upload images??

inzmam left a reply on Unable To Upload Video File

Interestingly, i have used FORM facade only to upload images which was uploaded successfully and stored in database table also. Just wanted to ask you if below code is causing an error,

//Image::make($video)->resize(400,200)->save($location);

    $vid->move($location,$filename);
    $vid->filename=$filename;
     $vid->path=$video;
    

inzmam left a reply on Unable To Upload Video File

Here is my form

' {{Form::open(['route'=>'pages.uploadVideo','files'=>true])}} {{Form::file('Upload_video',['style'=>'margin-top:10px;'])}} {{Form::submit('Upload Video',['class'=>'btn btn-default','style'=>'margin-top:10px;'])}} {{Form::close()}} '

inzmam started a new conversation Unable To Upload Video File

When i am going to upload a video file i m getting an error as "SQLSTATE[HY000]: General error: 1364 Field 'filename' doesn't have a default value (SQL: insert into video_stores (updated_at, created_at) values (2018-03-16 04:14:58, 2018-03-16 04:14:58))".

I don't why this error is being thrown, however i am passing all the values. Please help me in this case.

HomeController:- 'public function uploadVideo(Request $request) { $vid=new VideoStore; if($request->hasFile('Upload_video')) { $video=$request->file('Upload_video'); $filename=time().'.'.$video->getClientOriginalExtension(); $location=public_path('video/'.$filename);

        //Image::make($video)->resize(400,200)->save($location);
       
        $vid->move($location,$filename);
        $vid->filename='inzmam';
         $vid->path='ul haq';
        
    }
    $vid->save();
    Session::flash('success','Your video has been uploaded');
    return redirect()->route('pages.index');
}'

Migration:-

'public function up() { Schema::create('video_stores', function (Blueprint $table) { $table->increments('id'); $table->string('filename'); $table->string('path'); $table->timestamps(); }); }

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::dropIfExists('video_stores');
}'.
06 Mar
1 year ago

inzmam left a reply on Not Able To Pass Data To View

How can i achieve this, do you mean to say i need to write the below code

public function announcement($id) { $ann=announcement::find($id); return view('announcement.announcement')->withAnn($ann); }

if yes, i think i need to modify the Route also to achieve this which i have done but does not help me

inzmam left a reply on Not Able To Pass Data To View

yes, bcoz i need to display the data on the same view

inzmam left a reply on Not Able To Pass Data To View

How can i fix it then?

inzmam left a reply on Not Able To Pass Data To View

But this function is not being used to display the data,Its just being used to invoke the announcement.announcement view

inzmam left a reply on Not Able To Pass Data To View

Please check if this can help you in finding the issue.. But one thing is clear that when i pass the id of the announcement in URL manualy, it fixes the concern. Probabbly there is issue either in route or HomeController

inzmam left a reply on Not Able To Pass Data To View

('

public function announcement() { return view('announcement.announcement'); } public function storeAnnouncement(Request $request) { $messages=['title.required'=>'Please enter the title', 'announcement'=>'Please enter your announcement message']; $this->validate($request,[ 'title'=>'required|max:255', 'announcement'=>'required' ],$messages); $announcement=new announcement;

    $announcement->title=$request->title;
    $announcement->announcement=$request->announcement;

    $announcement->save();
    Session::flash('success','Your data has been saved');
    return redirect()->route('announcement.announcement',$announcement->id);
    
}
public function showAnnouncement($id)
{
    $ann=announcement::find($id);
    return view('announcement.announcement',['ann'=>$ann]);
    /*return view('announcement.announcement')->with('ann', $ann);*/
    /*return View::make('announcement.announcement',compact($ann));*/
}

')

inzmam left a reply on Not Able To Pass Data To View

I am unable to post the HomeController codes inspite of wrapping the code

inzmam left a reply on Not Able To Pass Data To View

When i pass the id of announcement in URL it displays the data perfectly. It might give you an idea about this issue

inzmam left a reply on Not Able To Pass Data To View

Here is Homecontroller.

================================

inzmam left a reply on Not Able To Pass Data To View

It does not fix the issue, I don't really understand why it is showing this error, earlier i have been passing the data to view in this way.

What could be any other probable reason??

inzmam started a new conversation Not Able To Pass Data To View

I am trying to pass a variable called $ann to the page called "announcement.announcement" but it shows as undefined variable.

Route::get('/announcement',['as'=>'announcement.announcement','uses'=>'[email protected]']); Route::post('/storeAnnouncement',['as'=>'announcement.storeAnnouncement','uses'=>'[email protected]']); Route::get('/announcement/{id}',['as'=>'announcement.show','uses'=>'[email protected]']);

=======================

public function storeAnnouncement(Request $request) { $messages=['title.required'=>'Please enter the title', 'announcement'=>'Please enter your announcement message']; $this->validate($request,[ 'title'=>'required|max:255', 'announcement'=>'required' ],$messages); $announcement=new announcement;

    $announcement->title=$request->title;
    $announcement->announcement=$request->announcement;

    $announcement->save();
    Session::flash('success','Your data has been saved');
    return redirect()->route('announcement.announcement',$announcement->id);
    
}
public function showAnnouncement($id)
{
    $ann=announcement::find($id);
    return view('announcement.announcement')->withAnn($ann);
}

========================================

section('title','|Announcement')

@section('content')

{{$ann->title}}

{!!Form::open(['route'=>'announcement.storeAnnouncement','class'=>'form-horizontal'])!!} {{Form::label('title','Title*')}} {{Form::text('title',null,['class'=>'form-control bottom-space'])}} {{Form::label('announcement','Announcement*')}} {{Form::textarea('announcement',null,['class'=>'form-control bottom-space'])}} {{Form::submit('Submit',['class'=>'btn btn-color btn-block'])}} {!!Form::close()!!} @endsection

15 Feb
1 year ago

inzmam left a reply on Getting Error As "array_merge(): Argument #2 Is Not An Array"

I have tried the redirect one also that also does not help me it shows as trying to get property of non-object which means item gets deleted but same is not redirected to the page

12 Feb
1 year ago

inzmam left a reply on Getting Error As "array_merge(): Argument #2 Is Not An Array"

Actually i totally don't understand why array_merge()???

inzmam left a reply on Getting Error As "array_merge(): Argument #2 Is Not An Array"

i have tried the code shared by, but same has not helped me.

inzmam left a reply on Getting Error As "array_merge(): Argument #2 Is Not An Array"

Thanks for your reply, i have used what you told but now i have got a new error as undefined variable 'post'

inzmam left a reply on Getting Error As "array_merge(): Argument #2 Is Not An Array"

$post_id is grabbing the id of the post where it will be returned once the comment is deleted from the post. Actually when i'm deleting the comment, it shows me this error and when i'm going back to the page where i had clicked to delete the comment, it shows me a message as your comment has been deleted. I will share few more code that might help you to figure out the issue.

delete.blade.php

Do you really want to delete this comment?

{{Form::model($comment,['route'=>['comments.destroy',$comment->id],'method'=>'DELETE'])}} {{Form::submit('Delete',['class'=>'btn btn-danger btn-block'])}} {{Form::close()}} CommentsController.php

public function delete($id) { $comment=Comment::find($id); return view('comments.delete')->withComment($comment);

}

/**
 * Remove the specified resource from storage.
 *
 * @param  int  $id
 * @return \Illuminate\Http\Response
 */
public function destroy($id)
{
    
    $comment=Comment::find($id);
    $post_id=$comment->post->id;
    $comment->delete();
    Session::flash('success','your comment has been deleted');
    return view('posts.show',$post_id);
}

route: Route::delete('comments/{id}',['uses'=>'[email protected]','as'=>'comments.destroy']); Route::get('comments/{id}/delete',['uses'=>'[email protected]','as'=>'comments.delete']);

below given code is where i start the process of deleting the comment.

inzmam left a reply on Getting Error As "array_merge(): Argument #2 Is Not An Array"

Thanks for your reply, i don't have any array in fact.

Probabbly i'm getting error here.

public function destroy($id) {

    $comment=Comment::find($id);
    $post_id=$comment->post->id;
    $comment->delete();
    Session::flash('success','your comment has been deleted');
    return view('posts.show',$post_id);
}           

inzmam started a new conversation Getting Error As "array_merge(): Argument #2 Is Not An Array"

When i am going to delete the comment from post, i am getting error as "array_merge(): Argument #2 is not an array". I am unable to guess the source of this error. Can someone help me this case.

10 Jan
1 year ago

inzmam left a reply on Unable To Load Form/Html In Laravel 5.4.36 Version

yes i did,

app.php

'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Auth\AuthServiceProvider::class,
    Illuminate\Broadcasting\BroadcastServiceProvider::class,
    Illuminate\Bus\BusServiceProvider::class,
    Illuminate\Cache\CacheServiceProvider::class,
    Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    Illuminate\Cookie\CookieServiceProvider::class,
    Illuminate\Database\DatabaseServiceProvider::class,
    Illuminate\Encryption\EncryptionServiceProvider::class,
    Illuminate\Filesystem\FilesystemServiceProvider::class,
    Illuminate\Foundation\Providers\FoundationServiceProvider::class,
    Illuminate\Hashing\HashServiceProvider::class,
    Illuminate\Mail\MailServiceProvider::class,
    Illuminate\Notifications\NotificationServiceProvider::class,
    Illuminate\Pagination\PaginationServiceProvider::class,
    Illuminate\Pipeline\PipelineServiceProvider::class,
    Illuminate\Queue\QueueServiceProvider::class,
    Illuminate\Redis\RedisServiceProvider::class,
    Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
    Illuminate\Session\SessionServiceProvider::class,
    Illuminate\Translation\TranslationServiceProvider::class,
    Illuminate\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,
    Collective\Html\HtmlServiceProvider::class,

],

'aliases'=>[ 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ],

composer.json

"require": { "php": ">=5.6.4", "laravel/framework": "5.4.*", "laravel/tinker": "~1.0", "laravelcollective/html": "^5.4.0" },

09 Jan
1 year ago

inzmam left a reply on Unable To Load Form/Html In Laravel 5.4.36 Version

Getting error as Class 'Form' not found

inzmam started a new conversation Unable To Load Form/Html In Laravel 5.4.36 Version

I want to make use of Form/Html in Laravel 5.4.36 version. I have tried to follow the instructions given in "https://laravelcollective.com/docs/5.4/html" but unfortunately that did not work for me. Can somebody help me in this case?

inzmam left a reply on Unable To Load HTML/Form Helper Laravel 5

I am using laravel 5.4.36 version, i have followed the steps as mentioned in laravelcollective.com, but i am unable to use the form and html, please help me somebody

04 Jan
1 year ago

inzmam left a reply on Admin And User Login Redirection

When i log in as an admin it redirects me to admin dashboard but when i log it out it doesn't take me to admin logim page instead takes me to home page....

And when i login as a user, it takes me to admin dashboard which i don't want to happen...

inzmam left a reply on Admin And User Login Redirection

Somebody...please help me in this case..

02 Jan
1 year ago

inzmam started a new conversation Admin And User Login Redirection

In my project, i am having a user login page and admin login page. I want my admin login page to redirect to admin-login.blade.php view on successful authentication and redirect back to admin login page on unsucessful, and i also want it redirect to admin-dashboard.blade.php if admin is already authenticated not to the admin login page. I have written code in RedirectIfAuthenticated.php to make it happen as below.

switch ($guard) { case 'admin': if(Auth::guard($guard)->check()) { return redirect()->route('admin.dashboard'); }

            break;
        default:
            if (Auth::guard($guard)->check())
            {
            return redirect('/home');
            }
        break;
    }
    return $next($request);

And in Handler.php as below:-

if ($request->expectsJson()) { return response()->json(['error' => 'Unauthenticated.'], 401); }

    $guard=array_get($exception->guards(),0);
    switch ($guard) {
        case 'admin':
            # code...
            $login='admin.login';
            break;
        
        default:
            # code...
            $login='login';
            break;
    }
    return redirect()->guest(route($login));

web.php

Route::get('/home', '[email protected]')->name('home'); Route::prefix('admin')->group(function() { Route::get('/login','Auth\[email protected]')->name('admin.login'); Route::post('/login','Auth\[email protected]')->name('admin.login.submit'); Route::get('/', '[email protected]')->name('admin.dashboard'); });

25 Dec
1 year ago
23 Dec
1 year ago

inzmam started a new conversation Base Table Or View Already Exists:1050 Table 'users' Already Exists In Connection.php Line 449

I am trying to create an admin migration but when i run the migration it shows error which i am unable to fix. However, i have tried a lot to serach an answer for this but didn't get.

php artisan make:migration create_admins_table --create=admins

this command creates migration but shows error while running the same.